On Sun, 21 Oct 2007, Holger Parplies wrote:

>> So, my script simply stops running after:
>> system("$rsyncPath @argList $newShare\n") || die "$rsyncPath @argList
>> $shareName failed!";
>
> Maybe because it should be "and" and not "or"? system returns the exit
> status of the program, so a 0 return value means success, causing the "die"
> to take effect. Aside from that, the die message quotes $shareName whereas
> the command uses $newShare. That may or may not be intended :).

Actually, in perl it's common to use the "do something or die" syntax. It 
does exactly what the syntax says; the first part must succeed (exit with 
0) or the program will die.

I would suggest modifying it to something like
system("$rsyncPath @argList $newShare\n") or die "$rsyncPath @argList 
$shareName failed with error: $!\n";

But be careful that you're redirecting STDOUT and STDERR to a file 
somewhere on the local host. Otherwise at that point in the script they may 
go nowhere (see below).

>> My question is - does BackupPC actively kill the "rsync" after the
>> backup is finished? I tried catching SIGPIPE and doing the cleanup
>> then, but that didn't help.
>
> Without looking at the code, I would suspect BackupPC to close the socket
> after transfer is finished (what else should it do? Wait for the remote side
> to close it?). I would imagine that might generate a SIGHUP (probably only
> if you've got a controlling tty). SIGPIPE should only be triggered if you
> try to write to a closed socket.

I'd guess that this is exactly what's happening; BackupPC closes the 
socket. Depending on the script on the remote side it could continue or die 
when it loses it's controlling tty.

I'm not sure there's a way to do what you want without using DumpPreUserCmd 
and DumpPostUserCmd scripts.

Cheers, Stephen
--
Stephen Joyce
Systems Administrator                                            P A N I C
Physics & Astronomy Department                         Physics & Astronomy
University of North Carolina at Chapel Hill         Network Infrastructure
voice: (919) 962-7214                                        and Computing
fax: (919) 962-0480                               http://www.panic.unc.edu

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/

Reply via email to