#!/bin/bash
# http://crystalfaeries.net/posix/bin/syncrsnapshots
# celeste:crystalfaery 2013-01-19 17:31:30+00:00
let result=0 # success
if [ "`hostname`" == "tb" ]
then
target="faery:/home/rsnapshot/hourly.0" # where do we copy our rsnapshots to?
cd /home/rsnapshot/hourly.0 || exit 255 # where do we copy our rsnapshots from?
for d in *
do
rsync -auvzH --delete $d $target
subresult=$?
if [[ $subresult -ne 0 ]]
then
let result=$subresult
exit $result # convey the first error
fi
done
fi
exit $result # convey the last exitcode
syntax highlighted by Code2HTML, v. 0.9.1