diff options
-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 } |