From 4a397b76a5944d1bc6a835c4983475213bcfa290 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Mon, 20 Feb 2006 03:35:25 +0000 Subject: Use separate excludes file. Exclude Maildir dovecot noise, stats websites and more. --- rdiff-backup/excludes | 7 ++++++- rdiff-backup/rdiff-backup.inc.sh | 12 +++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/rdiff-backup/excludes b/rdiff-backup/excludes index c710a65..3d7c981 100644 --- a/rdiff-backup/excludes +++ b/rdiff-backup/excludes @@ -1,3 +1,8 @@ **/cache/** **_scache.pag.* -**/websites/stats\.** +**/mail/.imap/** +**/Maildir/**/.imap.* +**/Maildir/**/dovecot.index* +**/jonas/src/** +**/pc/downloads/** +**/websites/stats.** diff --git a/rdiff-backup/rdiff-backup.inc.sh b/rdiff-backup/rdiff-backup.inc.sh index 133f03d..96877e8 100644 --- a/rdiff-backup/rdiff-backup.inc.sh +++ b/rdiff-backup/rdiff-backup.inc.sh @@ -26,12 +26,18 @@ function rdiffit() { echo "ERROR: host \"$host\" path \"$dir\" lacks leading \"/\"" continue fi + + excludes="" + while read exclude; do + excludes="$excludes --exclude $exclude" + done < /etc/local-COMMON/rdiff-backup/excludes + if [ "$host" = "`hostname -f`" ]; then - rdiff-backup --terminal-verbosity 1 --exclude '**/cache/**' --exclude '**_scache.pag.*' --exclude '**/mail/.imap/**' --exclude '**/jonas/src/**' --exclude '**/pc/downloads/**' /"$dir" "/var/local/backups/$host/rdiff-backup/${dir//\//-}" + rdiff-backup --terminal-verbosity 1 $excludes /"$dir" "/var/local/backups/$host/rdiff-backup/${dir//\//-}" elif [ -z "$up$down" ]; then - rdiff-backup --terminal-verbosity 1 --exclude '**/cache/**' --exclude '**_scache.pag.*' --exclude '**/mail/.imap/**' --exclude '**/jonas/src/**' --exclude '**/pc/downloads/**' --remote-schema 'ssh -o BatchMode=yes %s '\''rdiff-backup --server'\' $host::/"$dir" "/var/local/backups/$host/rdiff-backup/${dir//\//-}" + rdiff-backup --terminal-verbosity 1 $excludes --remote-schema 'ssh -o BatchMode=yes %s '\''rdiff-backup --server'\' $host::/"$dir" "/var/local/backups/$host/rdiff-backup/${dir//\//-}" else - rdiff-backup --terminal-verbosity 1 --exclude '**/cache/**' --exclude '**_scache.pag.*' --exclude '**/mail/.imap/**' --exclude '**/jonas/src/**' --exclude '**/pc/downloads/**' --remote-schema 'cstream -t '$up' | ssh -o BatchMode=yes %s '\''rdiff-backup --server'\'' | cstream -t '$down $host::/"$dir" "/var/local/backups/$host/rdiff-backup/${dir//\//-}" + rdiff-backup --terminal-verbosity 1 $excludes --remote-schema 'cstream -t '$up' | ssh -o BatchMode=yes %s '\''rdiff-backup --server'\'' | cstream -t '$down $host::/"$dir" "/var/local/backups/$host/rdiff-backup/${dir//\//-}" fi done } -- cgit v1.2.3