diff options
author | intrigeri <intrigeri@boum.org> | 2009-01-12 22:47:08 +0000 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2009-01-12 22:47:08 +0000 |
commit | a1c625fcc3c1bdcc81bb23aee3bea95051d6cc20 (patch) | |
tree | 52e6ef2f7aba7ad709d66a04a541e513cd6f06e2 | |
parent | 90a0dc695ad641fb988136cc6f31f44e31771efb (diff) | |
download | backupninja-a1c625fcc3c1bdcc81bb23aee3bea95051d6cc20.tar.gz backupninja-a1c625fcc3c1bdcc81bb23aee3bea95051d6cc20.tar.bz2 |
add support for 'when = manual' (Closes: #511299)
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | man/backup.d.5 | 3 | ||||
-rwxr-xr-x | src/backupninja.in | 7 |
4 files changed, 11 insertions, 3 deletions
@@ -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 @@ -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 diff --git a/man/backup.d.5 b/man/backup.d.5 index 5090051..fd5c9b2 100644 --- a/man/backup.d.5 +++ b/man/backup.d.5 @@ -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 diff --git a/src/backupninja.in b/src/backupninja.in index 6dee3b6..2a1b76e 100755 --- a/src/backupninja.in +++ b/src/backupninja.in @@ -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 |