-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackup-rsync
executable file
·30 lines (28 loc) · 955 Bytes
/
backup-rsync
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/bash
OPTIONS="-az --stats --timeout=300 --delete-after --delete-excluded"
DESTINATION="home"
echo "Rsync Backup on $HOSTNAME"
echo "========================="
echo `/bin/date`
rsync $OPTIONS /etc $DESTINATION:"$HOSTNAME"
rsync $OPTIONS /var $DESTINATION:"$HOSTNAME" \
--exclude="/var/cache/" \
--exclude="/var/lib/amavis/.spamassassin/bayes*" \
--exclude="/var/lib/amavis/.spamassassin/auto-whitelist" \
--exclude="/var/lib/amavis/tmp" \
--exclude="/var/lib/apt/" \
--exclude="/var/lib/clamav/" \
--exclude="/var/lib/cyrus/proc/" \
--exclude="/var/lib/dpkg/info/" \
--exclude="/var/lib/mysql/*/*.frm" \
--exclude="/var/lib/mysql/*/*.MY[DI]" \
--exclude="/var/lib/php5/" \
--exclude="/var/lib/ucf/cache/" \
--exclude="/var/lock/" \
--exclude="/var/run/" \
--exclude="/var/spool/postfix/" \
--exclude="/var/tmp/" \
--exclude="cache/"
echo `/bin/date`
echo
exit 0