#!/bin/bash
#
-# WizBackup Driver 1.0
+# WizBackup Driver 1.1
# Copyright 2011 Bernie Innocenti <bernie@codewiz.org>
#
# This program is free software: you can redistribute it and/or modify
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
+ flock -n $LOCKDIR/$host nice ionice -c2 -n6 \
+ wizbackup "$host:/" "$DEST/$host/" $opts >>$LOGFILE 2>&1
result=$?
end_time=$(date +%s)