diff options
author | Jonas Smedegaard <dr@jones.dk> | 2006-02-20 03:35:25 +0000 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2006-02-20 03:35:25 +0000 |
commit | 4a397b76a5944d1bc6a835c4983475213bcfa290 (patch) | |
tree | 329b5cd74efee83c8aebd1fed4db1c7c831d6b2d | |
parent | fa4fe1a41e15f56ac2350f73f96f056c7fc7ef0e (diff) |
Use separate excludes file. Exclude Maildir dovecot noise, stats websites and more.
-rw-r--r-- | rdiff-backup/excludes | 7 | ||||
-rw-r--r-- | 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 } |