parallel: --remove-source-files is not supported on old rsync.

This commit is contained in:
Ole Tange 2013-03-23 10:18:35 +01:00
parent 12897fe3c2
commit 3615f0b473

View file

@ -3778,14 +3778,13 @@ sub sshreturn {
my @cmd = (); my @cmd = ();
my $rsync_destdir = ($relpath ? "./" : "/"); my $rsync_destdir = ($relpath ? "./" : "/");
my $ret_file = $file; my $ret_file = $file;
my $remove = $opt::cleanup ? "--remove-source-files" : "";
# If relative path: prepend workdir/./ to avoid problems # If relative path: prepend workdir/./ to avoid problems
# if the dir contains ':' and to get the right relative return path # if the dir contains ':' and to get the right relative return path
my $replaced = ($relpath ? $self->workdir()."/./" : "") . $file; my $replaced = ($relpath ? $self->workdir()."/./" : "") . $file;
# --return # --return
# Abs path: rsync -rlDzR server:/home/tange/dir/subdir/file.gz / # Abs path: rsync -rlDzR server:/home/tange/dir/subdir/file.gz /
# Rel path: rsync -rlDzR server:./subsir/file.gz ./ # Rel path: rsync -rlDzR server:./subsir/file.gz ./
$pre .= "rsync $rsync_opt $remove $serverlogin:". $pre .= "rsync $rsync_opt $serverlogin:".
::shell_quote_scalar($replaced) . " ".$rsync_destdir.";"; ::shell_quote_scalar($replaced) . " ".$rsync_destdir.";";
} }
return $pre; return $pre;
@ -3813,13 +3812,15 @@ sub sshcleanup {
} }
my $relpath = ($file !~ m:^/:); # Is the path relative? my $relpath = ($file !~ m:^/:); # Is the path relative?
my $cleandir = ($relpath ? $workdir."/" : ""); my $cleandir = ($relpath ? $workdir."/" : "");
$cleancmd .= "$sshcmd $serverlogin rm -f " $cleancmd .= "rm -f "
. ::shell_quote_scalar($cleandir.$file.$removeworkdir).";"; . ::shell_quote_scalar($cleandir.$file.$removeworkdir).'\;';
} }
if(defined $opt::workdir and $opt::workdir eq "...") { if(defined $opt::workdir and $opt::workdir eq "...") {
$cleancmd .= "$sshcmd $serverlogin rm -rf " . ::shell_quote_scalar($workdir).";"; $cleancmd .= "rm -rf " . ::shell_quote_scalar($workdir).'\;';
}
if($cleancmd) {
$cleancmd = "$sshcmd $serverlogin ".$cleancmd.";";
} }
return $cleancmd; return $cleancmd;
} }
@ -3829,7 +3830,8 @@ sub cleanup {
my $self = shift; my $self = shift;
if($opt::cleanup) { if($opt::cleanup) {
my @transfer = $self->transfer(); my @transfer = $self->transfer();
return @transfer; my @return = $self->return();
return (@transfer,@return);
} else { } else {
return (); return ();
} }