From a2fcf5cd3d369e879e4181543e028d5bcff85e0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benoit=2ES=20=C2=AB=C2=A0Benpro=C2=A0=C2=BB?= Date: Sun, 4 Aug 2013 00:03:56 +0200 Subject: [PATCH] Rsync command line was bogus. Changing methods using rsync filter rules. --- INSTALL.md | 3 +- crons/zzz_evobackup | 12 +------- install/etc/evobackup/conf.d/exclude.cf | 24 ---------------- install/etc/evobackup/conf.d/include.cf | 38 +++++++++++++++++++++---- 4 files changed, 35 insertions(+), 42 deletions(-) delete mode 100644 install/etc/evobackup/conf.d/exclude.cf diff --git a/INSTALL.md b/INSTALL.md index 9f05c9f..9e55783 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -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. diff --git a/crons/zzz_evobackup b/crons/zzz_evobackup index 28acef1..4b49fc5 100644 --- a/crons/zzz_evobackup +++ b/crons/zzz_evobackup @@ -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 \ --include-from=/etc/evobackup/conf.d/include.cf \ - $rep \ - -e "ssh -p $SSHPORT -4" \ + / -e "ssh -p $SSHPORT -4" \ root@${BACKUPSERVER}:/var/backup/ > $tmplog status=$? diff --git a/install/etc/evobackup/conf.d/exclude.cf b/install/etc/evobackup/conf.d/exclude.cf deleted file mode 100644 index 1f7c766..0000000 --- a/install/etc/evobackup/conf.d/exclude.cf +++ /dev/null @@ -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 \ No newline at end of file diff --git a/install/etc/evobackup/conf.d/include.cf b/install/etc/evobackup/conf.d/include.cf index bf8ad70..200e463 100644 --- a/install/etc/evobackup/conf.d/include.cf +++ b/install/etc/evobackup/conf.d/include.cf @@ -1,5 +1,33 @@ -/etc -/root -/var -/home -/srv \ No newline at end of file +# 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 +- /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 \ No newline at end of file