Project Help Wanted
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherProject Help Wanted

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 8th, 2003, 07:17 PM
jennashton jennashton is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 138 jennashton User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 h 29 m 22 sec
Reputation Power: 6
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherProject Help Wanted > RCP or SCP files using Perl $50


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway