Package: backupninja
Version: 0.9.6-4
Severity: wishlist
Tags: patch

Hi,

Currently backupninja schedules all the backup action jobs that are
configured in the /etc/backup.d directory. However, I'd like to keep
configuration for some of the hosts under the directory but I would
rather not try backuping them up automatically each day since the
devices are seldom connected to the network. Instead, I'd like to run
these actions by launching backupninja on the backup server manually
with --run command line argument when I know the devices are ready for
backup. The attached patch (not very well tested, thougH) implements
scheduling

when = manual

which will cause backupninja to skip the configurations that are to be
run manually.

Regards,

-- 
Tuomas Jormola <t...@solitudo.net>
diff -ur backupninja-0.9.5.orig/man/backup.d.5 backupninja-0.9.5/man/backup.d.5
--- backupninja-0.9.5.orig/man/backup.d.5	2006-04-04 20:29:40.000000000 +0300
+++ backupninja-0.9.5/man/backup.d.5	2009-01-09 12:35:23.225766134 +0200
@@ -67,7 +67,7 @@
 
 .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 @@
   when = everyday at 01
   when = Tuesday at 05:00
   when = hourly
+  when = manual
 
 These values for "when" are invalid:
   when = tuesday at 2am
diff -ur backupninja-0.9.5.orig/src/backupninja.in backupninja-0.9.5/src/backupninja.in
--- backupninja-0.9.5.orig/src/backupninja.in	2007-10-12 20:42:46.000000000 +0300
+++ backupninja-0.9.5/src/backupninja.in	2009-01-09 12:32:36.326445517 +0200
@@ -201,6 +201,9 @@
 function isnow() {
 	local when="$1"
 	set -- $when
+
+	[ "$when" == "manual" ] && return 0
+
 	whendayofweek=$1; at=$2; whentime=$3;
 	whenday=`toint "$whendayofweek"`
 	whendayofweek=`tolower "$whendayofweek"`

Attachment: signature.asc
Description: Digital signature

Reply via email to