/usr/share/doc/simplesnap/examples/cron.hourly.simplesnap.backuphost is in simplesnap 1.0.3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | #!/bin/bash
# Reach out to each host hourly. This script runs on the backuphost.
set -e
# We load the SETNAME from a file I created with:
# echo setname > /bakfs/local-simplesnap-setname
SETNAME="`cat /bakfs/local-simplesnap-setname`"
# Or you could simply set it with:
# SETNAME="mainset"
SSHCMD="ssh -i /root/.ssh/id_rsa_simplesnap"
if [ -z "$SETNAME" ]; then
echo "Failure: couldn't find a setname"
exit 5
fi
# Change this to where you store your backups.
STORE="bakfs/simplesnap"
SIMPLESNAP () {
simplesnap --store "$STORE" --setname "$SETNAME" \
--sshcmd "$SSHCMD" "$@"
}
for HOST in host1 host2 host3 host4; do
SIMPLESNAP --host $HOST || echo "Simplesnap failure on host $HOST: $?"
done
# Only do laptophost at certain times
HOUR=`date +%H`
if [ "$HOUR" -eq 12 ] || [ "$HOUR" -lt 7 ] || [ "$HOUR" -gt 23 ] ; then
SIMPLESNAP --host laptophost || true # laptop, don't squawk
fi
|