Skip to content
Snippets Groups Projects
Commit a1c625fc authored by intrigeri's avatar intrigeri
Browse files

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

parent 90a0dc69
Branches
Tags
No related merge requests found
...@@ -28,3 +28,4 @@ romain.tartiere@healthgrid.org -- ldap fixes ...@@ -28,3 +28,4 @@ romain.tartiere@healthgrid.org -- ldap fixes
Adam Monsen - spec file updates Adam Monsen - spec file updates
Matthew Palmer <mpalmer@debian.org> -- halt loglevel feature Matthew Palmer <mpalmer@debian.org> -- halt loglevel feature
dan@garthwaite.org -- reportspace bugfix dan@garthwaite.org -- reportspace bugfix
Tuomas Jormola <tj@solitudo.net> -- "when = manual" option
...@@ -2,6 +2,9 @@ version 0.9.7 -- UNRELEASED ...@@ -2,6 +2,9 @@ version 0.9.7 -- UNRELEASED
backupninja changes backupninja changes
. fix bug in reportspace, thanks Dan Garthwaite . fix bug in reportspace, thanks Dan Garthwaite
. do not assume English locale when using date (Closes: #465837) . 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 handler changes
maildir: maildir:
. fix location of deleted_on file . fix location of deleted_on file
......
...@@ -67,7 +67,7 @@ Example templates for the action configuration files can be found in /usr/share/ ...@@ -67,7 +67,7 @@ Example templates for the action configuration files can be found in /usr/share/
.SH SCHEDULING .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: For example:
when = sundays at 02:00 when = sundays at 02:00
...@@ -76,6 +76,7 @@ For example: ...@@ -76,6 +76,7 @@ For example:
when = everyday at 01 when = everyday at 01
when = Tuesday at 05:00 when = Tuesday at 05:00
when = hourly when = hourly
when = manual
These values for "when" are invalid: These values for "when" are invalid:
when = tuesday at 2am when = tuesday at 2am
......
...@@ -208,6 +208,9 @@ nowdayofweek=`tolower "$nowdayofweek"` ...@@ -208,6 +208,9 @@ nowdayofweek=`tolower "$nowdayofweek"`
function isnow() { function isnow() {
local when="$1" local when="$1"
set -- $when set -- $when
[ "$when" == "manual" ] && return 0
whendayofweek=$1; at=$2; whentime=$3; whendayofweek=$1; at=$2; whentime=$3;
whenday=`toint "$whendayofweek"` whenday=`toint "$whendayofweek"`
whendayofweek=`tolower "$whendayofweek"` whendayofweek=`tolower "$whendayofweek"`
...@@ -298,9 +301,9 @@ function process_action() { ...@@ -298,9 +301,9 @@ function process_action() {
ret=$? ret=$?
IFS=$'\t\n' IFS=$'\t\n'
if [ $ret == 0 ]; then if [ $ret == 0 ]; then
debug "skipping $file because it is not $w" debug "skipping $file because current time does not match $w"
else else
info ">>>> starting action $file (because it is $w)" info ">>>> starting action $file (because current time matches $w)"
run="yes" run="yes"
fi fi
done done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment