projects
/
matthijs
/
upstream
/
backupninja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added 'daily', hours don't need 0 prefix.
[matthijs/upstream/backupninja.git]
/
backupninja
diff --git
a/backupninja
b/backupninja
index 3cd3cae1a1e487d6de202ebd08bc15088c0cb05c..a59d40067c9eafa3be4e183ee2d0f34ef2b34c9f 100755
(executable)
--- a/
backupninja
+++ b/
backupninja
@@
-199,9
+199,9
@@
function isnow() {
whendayofweek=$1; at=$2; whentime=$3;
whenday=`toint "$whendayofweek"`
whendayofweek=`tolower "$whendayofweek"`
whendayofweek=$1; at=$2; whentime=$3;
whenday=`toint "$whendayofweek"`
whendayofweek=`tolower "$whendayofweek"`
- whentime=`echo "$whentime" | sed 's/:[0-9][0-9]$//'`
+ whentime=`echo "$whentime" | sed 's/:[0-9][0-9]$//'
| sed -r 's/^([0-9])$/0\1/'
`
- if [ "$whendayofweek" == "everyday" ]; then
+ if [ "$whendayofweek" == "everyday"
-o "$whendayofweek" == "daily"
]; then
whendayofweek=$nowdayofweek
fi
whendayofweek=$nowdayofweek
fi
@@
-267,6
+267,8
@@
function process_action() {
getconf when "$defaultwhen"
if [ "$processnow" == 1 ]; then
info "running $file because of --now"
getconf when "$defaultwhen"
if [ "$processnow" == 1 ]; then
info "running $file because of --now"
+ elif [ "$when" == "hourly" ]; then
+ debug "running $file because 'when = hourly'"
else
IFS=$'\t\n'
for w in $when; do
else
IFS=$'\t\n'
for w in $when; do
@@
-317,10
+319,12
@@
function process_action() {
elif [ $_warnings != 0 ]; then
msg "*warning* -- $file"
errormsg="$errormsg\n== warnings from $file ==\n\n$ret\n"
elif [ $_warnings != 0 ]; then
msg "*warning* -- $file"
errormsg="$errormsg\n== warnings from $file ==\n\n$ret\n"
- elif [ $retcode == 0 ]; then
- msg "success -- $file"
else
else
- msg "unknown -- $file"
+ msg "success -- $file"
+# elif [ $retcode == 0 ]; then
+# msg "success -- $file"
+# else
+# msg "unknown -- $file"
fi
let "fatals += _fatals"
fi
let "fatals += _fatals"
@@
-406,6
+410,7
@@
getconf GZIP /bin/gzip
getconf RSYNC /usr/bin/rsync
[ -d "$configdirectory" ] || fatal "Configuration directory '$configdirectory' not found."
getconf RSYNC /usr/bin/rsync
[ -d "$configdirectory" ] || fatal "Configuration directory '$configdirectory' not found."
+[ -f "$logfile" ] || touch $logfile
if [ "$UID" != "0" ]; then
echo "$0 can only be run as root"
if [ "$UID" != "0" ]; then
echo "$0 can only be run as root"
@@
-427,7
+432,7
@@
errormsg=""
if [ "$singlerun" ]; then
files=$singlerun
else
if [ "$singlerun" ]; then
files=$singlerun
else
- files=`find $configdirectory -mindepth 1 `
+ files=`find $configdirectory -mindepth 1
| sort -n
`
fi
for file in $files; do
fi
for file in $files; do