Make the EXCLUDES/ALWAYS file optional
authorBernie Innocenti <bernie@codewiz.org>
Tue, 11 Oct 2011 03:33:47 +0000 (23:33 -0400)
committerroot <root@housetree.sugarlabs.org>
Tue, 11 Oct 2011 03:34:23 +0000 (23:34 -0400)
wizbackup-driver

index 1a5d0bc8bb06f24b0233ba46f7d0219e27a87ceb..6fbc2fdd2c257eb393d2668d1e99b104f7729638 100755 (executable)
@@ -45,10 +45,10 @@ else
 fi
 
 for host in $HOSTS; do
-       opts="--exclude-from $EXCLUDES_DIR/ALWAYS"
-       if [ -f "$EXCLUDES_DIR/$host" ]; then
-               opts="$opts --exclude-from $EXCLUDES_DIR/$host"
-       fi
+       opts=""
+       for file in "$EXCLUDES_DIR/ALWAYS" "$EXCLUDES_DIR/$host"; do
+               [ -f $file ] && opts="$opts --exclude-from $file"
+       done
 
        start_time=$(date +%s)
        flock $LOCKDIR/$host wizbackup "$host:/" "$DEST/$host/" $opts >>$LOGFILE 2>&1