add support for 'when = manual' (Closes: #511299)

This commit is contained in:
intrigeri 2009-01-12 22:47:08 +00:00
parent 90a0dc695a
commit a1c625fcc3
4 changed files with 11 additions and 3 deletions

View File

@ -28,3 +28,4 @@ romain.tartiere@healthgrid.org -- ldap fixes
Adam Monsen - spec file updates
Matthew Palmer <mpalmer@debian.org> -- halt loglevel feature
dan@garthwaite.org -- reportspace bugfix
Tuomas Jormola <tj@solitudo.net> -- "when = manual" option

View File

@ -2,6 +2,9 @@ version 0.9.7 -- UNRELEASED
backupninja changes
. fix bug in reportspace, thanks Dan Garthwaite
. do not assume English locale when using date (Closes: #465837)
. add 'when = manual' option, that can be used in the global config
file or in a given backup action file. Thanks Tuomas Jormola for the
preliminary patch (Closes: #511299)
handler changes
maildir:
. fix location of deleted_on file

View File

@ -67,7 +67,7 @@ Example templates for the action configuration files can be found in /usr/share/
.SH SCHEDULING
By default, each configuration file is processed everyday at 01:00 (1 AM). This can be changed by specifying the 'when' option in a backup action's config file or in the global configuration file.
By default, each configuration file is processed everyday at 01:00 (1 AM). This can be changed by specifying the 'when' option in a backup action's config file or in the global configuration file. Special value 'manual' will disable scheduling for the backup action. It is possible to run the backup action manually by invoking \fBninjahelper(1)\fP with --run command line argument.
For example:
when = sundays at 02:00
@ -76,6 +76,7 @@ For example:
when = everyday at 01
when = Tuesday at 05:00
when = hourly
when = manual
These values for "when" are invalid:
when = tuesday at 2am

View File

@ -208,6 +208,9 @@ nowdayofweek=`tolower "$nowdayofweek"`
function isnow() {
local when="$1"
set -- $when
[ "$when" == "manual" ] && return 0
whendayofweek=$1; at=$2; whentime=$3;
whenday=`toint "$whendayofweek"`
whendayofweek=`tolower "$whendayofweek"`
@ -298,9 +301,9 @@ function process_action() {
ret=$?
IFS=$'\t\n'
if [ $ret == 0 ]; then
debug "skipping $file because it is not $w"
debug "skipping $file because current time does not match $w"
else
info ">>>> starting action $file (because it is $w)"
info ">>>> starting action $file (because current time matches $w)"
run="yes"
fi
done