Mike Heins > Snapback2-1.001 > snapback_loop


Annotate this POD


New  6
Open  2
View/Report Bugs


snapback_loop -- loop waiting to call snapback2


  snapback_loop [-c configfile] &


This script just loops looking for a file in the communication directory, by default /tmp/backups. It then calls snapback2 with the specified configuration file name root based in /etc/snapback.

It exists to allow someone to start an ssh-agent, then walk away for unattended backup over a long period.

You would typically start the script with a few commands. For bash/ksh/sh:

        ## type ssh key passphrase when prompted
        ssh-agent > ~/.sshenv
        . ~/.sshenv
        snapback_loop >>/tmp/snapback_loop.log 2>&1 &

or tcsh/csh:

        ## type ssh key passphrase when prompted
        ssh-agent -c > ~/.sshenv
        source ~/.sshenv
        snapback_loop >>& /tmp/snapback_loop.log

The author has a machine dedicated to Snapback2, and this is in the rc.local so it starts on boot.

To initiate a backup, you just put entries in crontab like:

 18 * * * * touch /tmp/backups/snapback

The filename is the name of the snapback configuration file. The above would cause a call to:

            /usr/local/bin/snapback2 snapback

which is equivalent to

            /usr/local/bin/snapback2 -c /etc/snapback/snapback.conf

Errors in snapback are emailed to the AdminEmail address set in the snapback.conf configuration.

If the snapback configuration file is not specified with the -c command line option, the following files are checked for existence in order and the first one found is used:


If it is still not found, the defaults will be used.


-c configfile

The complete path to the configuration file to use. If not specified, defaults to:


Turns snapback2 debug on. Equivalent to setting "SnapbackOpts -d" in the configuration file. Will not override SnapbackOpts in the config, though.


Mike Heins, <mikeh@perusion.com>.

syntax highlighting: