aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Saxon <elijah@riseup.net>2005-02-26 21:26:09 +0000
committerElijah Saxon <elijah@riseup.net>2005-02-26 21:26:09 +0000
commit5e1f333927cb31c5eb589801b23a7ff52739d72a (patch)
treeaca3600adeda29fc7767cab64a05413c5a013f9f
parentb29b969b86d68d9fa0a70c6fd0b826cbb0ab49b2 (diff)
downloadbackupninja-5e1f333927cb31c5eb589801b23a7ff52739d72a.tar.gz
backupninja-5e1f333927cb31c5eb589801b23a7ff52739d72a.tar.bz2
added --run
-rwxr-xr-xbackupninja21
1 files changed, 19 insertions, 2 deletions
diff --git a/backupninja b/backupninja
index fb54378..81b1a17 100755
--- a/backupninja
+++ b/backupninja
@@ -352,6 +352,17 @@ while [ $# -ge 1 ]; do
# we shift here to avoid processing the file path
shift
;;
+ --run)
+ if [ -f $2 ]; then
+ singlerun=$2
+ processnow=1
+ debug=1
+ else
+ fatal "--run option must be fallowed by a backupninja action file"
+ usage
+ fi
+ shift
+ ;;
*)
fatal "Unknown option $1"
usage
@@ -406,7 +417,13 @@ warnings=0
actions_run=0
errormsg=""
-for file in $configdirectory/*; do
+if [ "$singlerun" ]; then
+ files=$singlerun
+else
+ files=`ls $configdirectory`
+fi
+
+for file in $files; do
[ -f $file ] || continue;
check_perms $file
@@ -424,7 +441,7 @@ for file in $configdirectory/*; do
msg "*missing handler* -- $file"
fi
done
-
+
## mail the messages to the report address
if [ $actions_run == 0 ]; then doit=0