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 ssh-add snapback_loop >>/tmp/snapback_loop.log 2>&1 &
or tcsh/csh:
## type ssh key passphrase when prompted ssh-agent -c > ~/.sshenv source ~/.sshenv ssh-add 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.
AdminEmail
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:
-c
/etc/snapback2.conf /etc/snapback/snapback2.conf /etc/snapback.conf /etc/snapback/snapback.conf
If it is still not found, the defaults will be used.
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>.
To install Backup::Snapback, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Backup::Snapback
CPAN shell
perl -MCPAN -e shell install Backup::Snapback
For more information on module installation, please visit the detailed CPAN module installation guide.