/
backup_home_partial
executable file
·30 lines (24 loc) · 1.43 KB
/
backup_home_partial
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
#!/bin/sh
DISPLAY=:0.0
export DISPLAY
if [ `/sbin/ifconfig eth0 | grep inet | grep -v inet6 | wc -l` -lt 1 ]; then
echo "Your eth0 interface is not up, so let's not overcrowd the wifi..." >> /home/gsacre/var/log/backup.log
exit 1
fi
if [ `grep -i softkinetic /etc/resolv.conf | wc -l` -lt 1 ]; then
echo "You are not on the Softkinetic network... I go back to sleep..." >> /home/gsacre/var/log/backup.log
exit 2
fi
if [ ! -d /mnt/u/backup_home ]; then
echo "Your personal folder is not mounted. Mounting..." >> /home/gsacre/var/log/backup.log
mount /mnt/u
fi
if [ ! -d /mnt/u/backup_home ]; then
echo "Ok, it seems we have a serious problem... Exiting..." >> /home/gsacre/var/log/backup.log
exit 1
fi
notify-send -u low "BACKUP" "Starting incremental backup of HOME"
echo "Backup incremental of /home/gsacre starting at `date`" >> /home/gsacre/var/log/backup.log
duplicity incr --allow-source-mismatch --encrypt-key 0C3DCFF4 --exclude /home/gsacre/projects --exclude /home/gsacre/Downloads --exclude /home/gsacre/backup --exclude /home/gsacre/sources --exclude /home/gsacre/Maildir --exclude /home/gsacre/.cache --exclude /home/gsacre/VirtualBox_VMs --exclude /home/gsacre/SpiderOak --exclude /home/gsacre/tmp /home/gsacre file:///mnt/u/backup_home >> /home/gsacre/var/log/backup.log
echo "Backup incremental of /home/gsacre finished at `date`" >> /home/gsacre/var/log/backup.log
notify-send -u low "BACKUP" "Ended incremental backup of HOME"