projects
/
matthijs
/
upstream
/
backupninja-vserver.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added enhanced options to ldap handler
[matthijs/upstream/backupninja-vserver.git]
/
backupninja
diff --git
a/backupninja
b/backupninja
index 3cd3cae1a1e487d6de202ebd08bc15088c0cb05c..380ffcc37f0e1afd7f7ae8edada2f63fcb46b045 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"
@@
-398,6
+402,7
@@
defaultwhen=$when
getconf logfile /var/log/backupninja.log
getconf usecolors "yes"
getconf SLAPCAT /usr/sbin/slapcat
getconf logfile /var/log/backupninja.log
getconf usecolors "yes"
getconf SLAPCAT /usr/sbin/slapcat
+getconf LDAPSEARCH /usr/bin/ldapsearch
getconf RDIFFBACKUP /usr/bin/rdiff-backup
getconf MYSQL /usr/bin/mysql
getconf MYSQLHOTCOPY /usr/bin/mysqlhotcopy
getconf RDIFFBACKUP /usr/bin/rdiff-backup
getconf MYSQL /usr/bin/mysql
getconf MYSQLHOTCOPY /usr/bin/mysqlhotcopy
@@
-406,6
+411,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
+433,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