5 if mountpoint
-q /mnt
/backupdrive
; then umount
/mnt
/backupdrive
; fi
11 echo "Was this script called from udev? I need the UUID as the first argument" > /home
/mrl
/backup.log
13 elif mountpoint
-q /mnt
/backupdrive
15 cat<<MAIL | su -c 'ssh helheim /usr/lib/sendmail backups@martlubbers.net' mrl
16 To: mart@martlubbers.net
17 From: backups@martlubbers.net
18 Subject: Backup failed ($start)
19 Backup failed at at $(date) because /mnt/backupdrive was already a mountpoint
23 mkdir
-p /mnt
/backupdrive
/home
/mrl
/mnt
/backupdrive
/mnt
/data
&&\
24 rsync
--delete --bwlimit=20M
--exclude 'minidlna/*' --exclude 'transmission/ipt/*' -va /mnt
/data
/ /mnt
/backupdrive
/mnt
/data
> /home
/mrl
/backup.log
&&\
25 rsync
--delete --bwlimit=20M
--exclude '.local/share' --exclude '.cache' --exclude 'VirtualBox VMs' -va /home
/mrl
/ /mnt
/backupdrive
/home
/mrl
>> /home
/mrl
/backup.log
&&\
26 umount
/mnt
/backupdrive
&&\
27 cat<<MAIL | su -c 'ssh helheim /usr/lib/sendmail backups@martlubbers.net' mrl
28 To: mart@martlubbers.net
29 From: backups@martlubbers.net
30 Subject: Backup finished ($start)
31 Successfully finished at $(date)