Merge branch 'dev' | Fix rsync command line and excludes.

This commit is contained in:
Benoit.S « Benpro » 2013-08-04 12:06:59 +02:00
commit 46dddc7359
4 changed files with 37 additions and 43 deletions

View file

@ -93,8 +93,7 @@ In /etc/evobackup:
commented out. Un-comment or write your own code, this will be launched
before the rsync, using run-parts.
* What to include in conf.d/include.cf
* What to exclude in conf.d/exclude.cf
* What to backup using rsync filter rules in conf.d/include.cf
* General config in conf.d/cron.cf
6) Optional, test with sh -x.

View file

@ -20,21 +20,11 @@ system=$(uname -o)
hostname=$(hostname -f)
start=$(date --rfc-3339=seconds)
tmplog=$(mktemp --tmpdir=/tmp evobackup.XXX)
if [ "$system" = "GNU/Linux" ]; then
rep="/bin /boot /lib /opt /sbin /usr"
elif [ "$system" = "FreeBSD" ]; then
rep="/bsd /bin /boot /sbin /usr"
else
# Not GNU/Linux or FreeBSD
rep=""
fi
# rsync command line to backup all data.
rsync -avz --delete --force --ignore-errors --partial \
--exclude-from=/etc/evobackup/conf.d/exclude.cf \
rsync -avz --force --ignore-errors --partial \
--include-from=/etc/evobackup/conf.d/include.cf \
$rep \
-e "ssh -p $SSHPORT -4" \
--delete --delete-excluded / -e "ssh -p $SSHPORT -4" \
root@${BACKUPSERVER}:/var/backup/ > $tmplog
status=$?

View file

@ -1,24 +0,0 @@
lost+found
.nfs.*
/var/log
/var/log/evobackup*
/var/lib/mysql
/var/lib/postgres
/var/lib/postgresql
/var/lib/sympa
/var/lib/metche
/var/run
/var/lock
/var/state
/var/apt
/var/cache
/usr/src
/usr/doc
/usr/share/doc
/usr/obj
dev
/var/spool/postfix
/var/lib/amavis/amavisd.sock
/var/lib/munin/munin-update.stats.tmp
/var/lib/php5
/var/spool/squid

View file

@ -1,5 +1,34 @@
/etc
/root
/var
/home
/srv
# Use this file to exlude files (-) or explicit include (+).
# Exemple, backup /home/backup/mysql.bak.gz but not what is left in /home/backup
# + /home/backup/mysql.bak.gz
# - /home/backup/**
# General excludes.
- lost+found
- .nfs.*
- /backup
- /dev
- /proc
- /selinux
- /run
- /sys
- /usr/src
- /usr/doc
- /usr/share/doc
- /usr/obj
- /var/log
- /var/lib/mysql
- /var/lib/postgres
- /var/lib/postgresql
- /var/lib/sympa
- /var/lib/metche
- /var/run
- /var/lock
- /var/state
- /var/apt
- /var/cache
- /var/spool/postfix
- /var/lib/amavis/amavisd.sock
- /var/lib/munin/munin-update.stats.tmp
- /var/lib/php5
- /var/spool/squid