diff --git a/ChangeLog b/ChangeLog index 09c4747f27a7c17bf6dfc1d6fab3f9996c420a16..d9a6906a0a2b15510561ee1a4e97cedc0de006c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -35,12 +35,13 @@ version 0.9.6 -- unreleased . make deleted maildirs record the date they were deleted . add destid_file configuration option to enable you to specify an alternate ssh public key authentication file (defaulting to /root/.ssh/id_rsa) - pgsql, mysql, svn: + pgsql, mysql, svn, sys: . use new vservers_running function from lib/vserver (factorization++) sys: . update for 2.6 kernels: use /proc/kallsyms instead of /proc/ksyms (Closes: Trac#39) - . use new vservers_running function from lib/vserver + . support selection of VServers to run on, in the same way as in the + dup handler, with the new vsnames configuration option ; (Closes: Trac#45) version 0.9.5 -- December 2, 2007 backupninja changes diff --git a/examples/example.sys b/examples/example.sys index 908133479475b494881b7469dc02dd3f5a679a6d..2a6bf0f303cd5b836b5c5d7ad72b62499d5a9032 100644 --- a/examples/example.sys +++ b/examples/example.sys @@ -39,3 +39,6 @@ # hardwarefile = /var/backups/hardware.txt # dohwinfo = yes +# If vservers = yes in /etc/backupninja.conf then the following variables can +# be used: +# vsnames = all | <vserver1> <vserver2> ... (default = all) diff --git a/handlers/sys.helper.in b/handlers/sys.helper.in index 6451ae299669233c42e85c4d180e3f643d0f2c49..e39e5267a7fc12ad40f1927ec5e818ae710a6dfe 100644 --- a/handlers/sys.helper.in +++ b/handlers/sys.helper.in @@ -32,6 +32,10 @@ $hardware # packagesfile = /var/backups/dpkg-selections.txt # partitionsfile = /var/backups/partitions.__star__.txt # hardwarefile = /var/backups/hardware.txt + +# If vservers = yes in /etc/backupninja.conf then the following variables can +# be used: +# vsnames = all | <vserver1> <vserver2> ... (default = all) EOF chmod 600 $next_filename } diff --git a/handlers/sys.in b/handlers/sys.in index 0f863d7bd297d218434af7eb487afef9294fae62..455234d8bf76c0b4139eade6bad6af1ff9abaf15 100755 --- a/handlers/sys.in +++ b/handlers/sys.in @@ -73,11 +73,18 @@ getconf HWINFO `which hwinfo` getconf sfdisk_options "" getconf hwinfo_options "" -# See if vservers are configured +getconf vsnames all + +# If vservers are configured, check that the ones listed in $vsnames are running. local usevserver=no -if [ $vservers_are_available = yes ] -then - info "vserver method enabled" +if [ $vservers_are_available = yes ]; then + if [ "$vsnames" = all ]; then + vsnames="$found_vservers" + fi + if ! vservers_running "$vsnames" ; then + fatal "At least one of the vservers listed in vsnames ($vsnames) is not running." + fi + info "Using vservers '$vsnames'" usevserver=yes fi @@ -91,7 +98,7 @@ if [ "$packages" == "yes" ]; then if [ $usevserver = yes ]; then info "vserver root directory set to: $VROOTDIR" - for vserver in $found_vservers; do + for vserver in $vsnames; do info "examining vserver: $vserver" # is it running ? vservers_running $vserver