start="$(date)"
if [ ! -n "$1" ]
then
- echo "Was this script called from udev? I need the ID_FS_UUID_ENC variable" | tee /home/mrl/backup.log
+ echo "Was this script called from udev? I need the UUID as the first argument" > /home/mrl/backup.log
exit 1
elif mountpoint -q /mnt/backupdrive
then
then
mkdir -p /mnt/backupdrive/home/mrl /mnt/backupdrive/mnt/data &&\
rsync --delete --bwlimit=20M --exclude 'minidlna/*' --exclude 'transmission/ipt/*' -va /mnt/data/ /mnt/backupdrive/mnt/data > /home/mrl/backup.log &&\
- rsync --delete --bwlimit=20M -va /home/mrl/ /mnt/backupdrive/home/mrl >> /home/mrl/backup.log &&\
+ rsync --delete --bwlimit=20M --exclude 'VirtualBox VMs' -va /home/mrl/ /mnt/backupdrive/home/mrl >> /home/mrl/backup.log &&\
umount /mnt/backupdrive &&\
cat<<MAIL | su -c 'ssh helheim /usr/lib/sendmail backups@martlubbers.net' mrl
To: mart@martlubbers.net