aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlookshe <github@lookshe.org>2015-05-08 09:37:12 +0200
committerlookshe <github@lookshe.org>2015-05-08 09:37:12 +0200
commit6521c437b1162d1bbfc6cc0a772871eebb431622 (patch)
tree4bc17f15dd0b7bd323183890acbeec908af83163
parent81b7cdc53baa4df70efeafda6df454c4053fcfbe (diff)
add possibility to exclude files from backup
-rwxr-xr-xbackup.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/backup.sh b/backup.sh
index 8008f8c..ed381cf 100755
--- a/backup.sh
+++ b/backup.sh
@@ -116,7 +116,12 @@ do
# tar is not able to handle unix-timestamps, so we calculate the required one
tar_stamp=$(date -d "1970-01-01 $last_stamp sec" +%F)
# only changed files since last modification in backup
+ if [ -f "$dir_single_soft_link_path/backup.ignore" ]
+ then
+ nice -n 19 tar czf "$dir_single.$backup_stamp.tar.gz" --warning=none --exclude-from="$dir_single_soft_link_path/backup.ignore" -N "$tar_stamp" "$dir_single_soft_link_path"
+ else
nice -n 19 tar czf "$dir_single.$backup_stamp.tar.gz" --warning=none -N "$tar_stamp" "$dir_single_soft_link_path"
+ fi
rsync_server "$dir_single.$backup_stamp.tar.gz" "$backupdir/$backupdirsingle/" "${config_single}_$dir_single"
# delete backups from local
rm -f "$dir_single.$backup_stamp.tar.gz"
@@ -125,7 +130,12 @@ do
if [ "$do_monthly" = "yes" -o "$do_normal" = "yes" ]
then
# backup everything
+ if [ -f "$dir_single_soft_link_path/backup.ignore" ]
+ then
+ nice -n 19 tar czf "$dir_single.tar.gz" --warning=none --exclude-from="$dir_single_soft_link_path/backup.ignore" "$dir_single_soft_link_path"
+ else
nice -n 19 tar czf "$dir_single.tar.gz" --warning=none "$dir_single_soft_link_path"
+ fi
# check wether we should rotate
if [ "$rotate" != "inc" -a "$do_normal" = "yes" ]
then