CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Advanced:
rsync perl



May 11, 2010, 3:52 AM

Post #1 of 2 (3497 views)
rsync perl Can't Post

hi ! i have a problem with my script . im trying to rsync the directory backup_dbase and also its contents through my Perl script. But , when i schedule it to run every minute with cron it returns error code 65280 and also the '$!' says bad file Descriptor. When i run rsync through command line everything is fine ,it works! what is going wrong with this ? Also sometimes returns the code 3072 .


$sys=system ("/usr/bin/rsync -avz --rsh=/usr/bin/ssh -i /root/.ssh/mirror_id_rsa /root/backup_dbase root\" ) ;
if($sys != 0)
{print MYFILE "rsync error $sys : $! \n";
print MYFILE "----------------------------------------------------------------------------------\n";}

(This post was edited by xenovass on May 11, 2010, 3:53 AM)

Veteran / Moderator

May 11, 2010, 4:57 AM

Post #2 of 2 (3491 views)
Re: [xenovass] rsync perl [In reply to] Can't Post

Start by adding these 2 pragmas, which should be in every Perl script you write, and fix the issues they point out.

use strict; 
use warnings;

Then use the list form of the system call.

If you still have the same problem, then use the File::Rsync module instead of the system call.


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives