|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
RCP or SCP files using Perl $50
Hello,
I have a script that basically copy files from a directory to another directory on the same server. But, now I need to add to that script. It will copy the same files to another unix server using the same script. Below is my script. Will pay $50 via PayPal if you can add to this script that will copy what's written to $dest to another unix server with the same file structure. It has to copy the latest file, so it will probably need comparison as I have below. Can't use Rsync... SCP is okay. Let me know ASAP. #!/usr/bin/perl use File::Find; use File::Copy; use File::Path; print "Location: http://www.somewhere.com/afile/index.html\n\n"; print "Content-Type: text/html\n\n"; my $top_src = "/usr/local/data/www/doc1"; my $dest = "/usr/local/data/www/doc2"; find sub { return unless -f ; my $more_subdir; for ( $more_subdir = $File::Find::dir) { s#^\Q$top_src##; s#^/##; } if (-e "$dest/$more_subdir/$_" and -M "$dest/$more_subdir/$_" <= -M $_) { return; } mkpath( ["$dest/$more_subdir"], 0, 0775); # $dest must be an absolute chmod 0775, "$dest/$more_subdir"; copy $_, "$dest/$more_subdir/$_"; chmod 0664, $_, "$dest/$more_subdir/$_"; }, $top_src; exit; So, the script will need to copy from $top_src to $desc and another server with the same file directory. Last edited by jennashton : December 8th, 2003 at 07:20 PM. |
![]() |
| Viewing: Dev Shed Forums > Other > Project Help Wanted > RCP or SCP files using Perl $50 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|