]> code.delx.au - monosys/blob - scripts/backup-generic
html encode stuff
[monosys] / scripts / backup-generic
1 #!/bin/bash -e
2
3 # Run this at a lower priority to avoid disrupting the rest of the system
4 # Exclude other filesystems from the backup. This leaves only the files we
5 # want, on the root file system, to back up.
6 # Also exclude other large collections of files which we don't care to save.
7
8 if [ -f /.backup_running ]; then
9 echo "Backup already running!"
10 exit 1
11 fi
12
13 touch /.backup_running
14
15 ionice -c3 nice -n5 \
16 rdiff-backup \
17 --exclude-other-filesystems \
18 --exclude-sockets \
19 --exclude '/backup' \
20 --exclude '/tmp' \
21 --exclude '/var/cache/apt/archives' \
22 --exclude '/var/log' \
23 / /backup/
24 # Remove old backups
25 sleep 3600
26 ionice -c3 nice -n5 rdiff-backup -v1 --remove-older-than 60D /backup/
27
28 rm -f /.backup_running
29
30 exit 0
31