Hi Todd,
Here is a sample list of files this a user would see on an HTML page with
check boxes.
1. checkbox FOLDER.GIF
2. checkbox HTMLFILE.GIF
3. checkbox download/install/FOLDER.GIF
4. checkbox download/install/HTMLFILE.GIF
5. checkbox download/install/index.html
If I choose number 1 and 2, I ONLY want to update 1 and 2, and not anything
else, but if I choose 1-4, rsync needs to update 1-4. So, my point is,
rsync is getting created dynamically. The way it is set up now, if I choose
FOLDER.GIF (1), both 1 and 3 get updated or if I choose (2), both 2 and 4
get updated. That is not want I want.
Here is the whole sub-routine:
my $switches = "-gHloprtv";
my $in_excludeFiles = "";
my $comment = "";
my $delete = " --delete ";
sub processCgiCall() {
foreach $host (sort keys %destHost) {
@keyArray = split(/,/,$arg{'CheckBoxNames'});
$in_excludeFiles = " --include \"*\/\" ";
foreach ( 0..$#keyArray ) {
my $file = "$keyArray[$_]";
if ( $file =~ m/deleting/ ) {
($filler, $file) = split (/ /,$file);
}
$in_excludeFiles .= " --include \"$file\" ";
}
$in_excludeFiles .= " --exclude \"*\" ";
setRsync();
open(RSYNC, "$rsync |");
while (<RSYNC>) {
if ( $_ =~ m/.\/$/ || $_ =~ m/building file list/ || $_ =~ m/wrote
(\w)/ ||
$_ =~ m/total size is/ || $_ =~ m/\/$/ ) {
next;
}
if (m/deleting/) {
print "<FONT COLOR=red>
$_<BR>
</FONT>";
}
else {
print " $_<BR>";
}
}
close(RSYNC);
}
} # <=== End of sub processCgiCall().
sub setRsync() {
$rsync = "/usr/bin/rsync $delete $switches $in_excludeFiles $srcDir
$destDir 2>&1";
} # <=== End of sub setRsync.
I sure hope someone can help with this.
Thanks.
Peter
-----Original Message-----
From: Bennett Todd [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 18, 2000 9:48 AM
To: Peter Loo
Cc: [EMAIL PROTECTED]
Subject: Re: I don't want to recursively copy the same file in all
sub-directories...
I may be missing something excruciatingly basic here, but why, if
you only want to sync specified, individual files, are you including
the -r flag for recursive do-everything?
-Bennett