Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use File::Find; use File::Basename; @backupFiles=(); %chompedList=(); $list="/usr/scripts/blist.txt"; if(-e $list){unlink($list);} system("ssh user\@backupserver ls -c /usr/local/apache/htdocs >$list") +; open(LIST, "$list") or die "$!"; @backupFiles = <LIST>; foreach $file (@backupFiles){chomp $file; $chompedList{$file} = $file; +} find(\&dofile, </usr/myfiles/*.htm>); sub dofile { ($name,$path,$suffix) = fileparse($File::Find::name); if (not exists $chompedList{"$name$suffix"}) { system("scp -C \"$File::Find::name\" user\@backupserver:/usr/local/apa +che/htdocs"); } }#end find close(list); unlink($list);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: scp cronjob
by ides (Deacon) on Sep 11, 2002 at 14:24 UTC | |
Re: scp cronjob
by mp (Deacon) on Sep 11, 2002 at 16:48 UTC | |
Re: scp cronjob
by Util (Priest) on Sep 11, 2002 at 17:43 UTC | |
Re: scp cronjob
by kabel (Chaplain) on Sep 11, 2002 at 12:58 UTC | |
Re: scp cronjob
by Anonymous Monk on Sep 14, 2002 at 22:44 UTC |