X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=rsync-piper.pl;h=9979c2331b4df588a6d36b1a01271f1ce65f04bd;hb=925ecfc00ce5ab771ff4337fcb9f1b27dc9570cb;hp=00eb45b828baa4a1879f49b99681521ce0d56ee8;hpb=4f532b4a03ebc72bfef5b0212205910457bffd20;p=cloudstore.git diff --git a/rsync-piper.pl b/rsync-piper.pl index 00eb45b..9979c23 100755 --- a/rsync-piper.pl +++ b/rsync-piper.pl @@ -49,7 +49,7 @@ my @transfer_names = map { ( split(/:/,$_,3) )[0] } @transfer; my $transfer_log = join('|',map { ( split(/:/,$_,3) )[1] } @transfer ); if ( $ENV{SQL} ) { - print "CREATE TABLE rsync_transfer (\n\t", + warn "CREATE TABLE rsync_transfer (\n\t", join(",\n\t", map { my @m = split(/:/,$_,3); "$m[0] $m[2]" } @transfer), "\n);\n"; exit 1; @@ -87,6 +87,9 @@ strict modes = no #pre-xfer exec = /srv/cloudstore/rsync-xfer-trigger.pl #post-xfer exec = /srv/cloudstore/rsync-xfer-trigger.pl +# inplace breaks update of deduped files +refuse options = inplace + }; open(my $p, '<', '/var/lib/extrausers/passwd'); @@ -122,7 +125,7 @@ while(<$p>) { __RSYNC_MODULE__ - print "INFO: added $login = $auth_users\n"; + warn "INFO: added $login = $auth_users\n"; } else { warn "skipped $login: $!"; @@ -180,7 +183,7 @@ sub REAPER { $SIG{CHLD} = \&REAPER; -if ( ! -e $pid_file ) { +if ( ! -e $pid_file || ! kill( 0, rsync_running_pid ) ) { my $exec = "$rsync --daemon --config $cfg_file --no-detach --port=$port"; warn "START $exec\n";