my $shell_client = <<__SHELL_CLIENT__;
#!/bin/sh
+#echo \$USER/\$SUDO_USER $install `pwd` \$* | nc 127.0.0.1 9001
echo \$USER/\$SUDO_USER `hostname` `pwd` \$* | nc $server_ip 9001
__SHELL_CLIENT__
print $files "$_\n" foreach @_;
close($files);
}
- rsync( qw( -avv --files-from /tmp/$hostname.list root\@$hostname:/ $hostname/ ) );
+ rsync split / /, "-avv --files-from /tmp/$hostname.list root\@$hostname:/ $hostname/";
}
while (my $client = $server->accept()) {
$command = 'log --patch-with-stat' if $command =~ m/^ch/;
pull_changes( $hostname ) if $command eq 'diff';
if ( $on_host ) {
+ mkpath $_ foreach grep { ! -e $_ } ( "$hostname/$dir", "$on_host/$dir" );
rsync( '-avv', "root\@$hostname:$path", "$hostname/$path" );
rsync( '-avv', "root\@$on_host:$path", "$on_host/$path" );
open(my $diff, '-|', "diff -Nuw $hostname$path $on_host$path");
print $client $_;
}
close($file);
+ } elsif ( $command eq 'ls' ) {
+ print $client `ls $backup_path`;
} else {
print $client "Unknown command: $command\n";
}