(I invite Craig Barratt and any developer to check out my last paragraph below.)
> it doesn't seem like ssh actually *is* backgrounded. I didn't read > the tutorial and haven't played around with this, so I'm not quite > sure *what* you would want to background to keep the tunnel open > [long enough]. You would obviously need to background *something*, > otherwise BackupPC would wait for the tunnel to close and the > DumpPreUserCmd to finish before proceeding with the backup, wouldn't > it? SSH is backgrounded with the -f switch. Perl/BackupPC is tricked to understand this by redirecting stdout and stderr. Otherwise it still waits until they stop even when SSH is backgrounded. > - The "sleep" on the client? That wouldn't help, because "ssh" > wouldn't terminate before "sleep" is done. As above, SSH goes to the "background just before command execution" it is not supposed to terminate at this point. > - The "ssh" command? Then how do you know whether it started > successfully? - The script which starts ssh (or, equivalently, the > "ssh && echo" sequence)? How do you tell BackupPC whether the "ssh" > was successful (return code of the DumpPreUserCmd, determining > whether to proceed with the backup or not)? By using "&&". It's a shell syntax meaning about 'and if successful', in other words I believe it checks the exit status of the previous command. This makes the BackupPC log show "SSH started successfully." as we can't use SSH itself to tell us that. The question of actually proceeding with the backup or not is a good one. I haven't explored any integration with BackupPC, so far having the backup run and fail on its own has been sufficient. One way would be to create a ping replacement/multifunction wrapper for the tunnel. Now that you brought this up, I actually realized that integrating the whole tunnel functionality in BackupPC would be pretty easy in theory. A single conf line or split up into simple parts (GATE, CLIENT, and a "enable tunnel"-switch) would perhaps suffice as the ports could be handled dynamically. Thanks for the input! -- Johan Ehnberg Email: jo...@ehnberg.net GSM: +358503209688 WWW: http://ehnberg.net/johan.html ------------------------------------------------------------------------------ This SF.net email is sponsored by: High Quality Requirements in a Collaborative Environment. Download a free trial of Rational Requirements Composer Now! http://p.sf.net/sfu/www-ibm-com _______________________________________________ BackupPC-users mailing list BackupPC-users@lists.sourceforge.net List: https://lists.sourceforge.net/lists/listinfo/backuppc-users Wiki: http://backuppc.wiki.sourceforge.net Project: http://backuppc.sourceforge.net/