X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fupstream%2Fbackupninja.git;a=blobdiff_plain;f=handlers%2Fsys.in;h=455234d8bf76c0b4139eade6bad6af1ff9abaf15;hp=2e181c85c2a27fba52f3441958eec01ea79bcd0b;hb=fd6796ad99b90371594c3068e6d8bbbdb2b1d1d5;hpb=579ea902ba24854b3c9acb307cda7e996e8e41a3 diff --git a/handlers/sys.in b/handlers/sys.in index 2e181c8..455234d 100755 --- a/handlers/sys.in +++ b/handlers/sys.in @@ -32,46 +32,59 @@ else warning "Unknown OS detected!" fi +getconf parentdir /var/backups getconf packages yes getconf dosfdisk yes getconf dohwinfo yes + +if [ ! -d $parentdir ]; then + mkdir -p $parentdir +fi + if [ $os = "debian" ] then - getconf packagesfile /var/backups/dpkg-selections.txt + getconf packagesfile $parentdir/dpkg-selections.txt getconf packagemgr `which dpkg` getconf packagemgroptions ' --get-selections *' elif [ $os = "redhat" ] then - getconf packagesfile /var/backups/rpmpackages.txt + getconf packagesfile $parentdir/rpmpackages.txt getconf packagemgr `which rpm` getconf packagemgroptions ' -qa ' getconf SYSREPORT `which sysreport` getconf sysreport_options ' -norpm ' else - getconf packagesfile /var/backups/unknownOS.txt + getconf packagesfile $parentdir/unknownOS.txt fi packagemgroptions="${packagemgroptions//__star__/*}" getconf partitions yes -getconf partitionsfile /var/backups/partitions.__star__.txt +getconf partitionsfile $parentdir/partitions.__star__.txt getconf hardware yes -getconf hardwarefile /var/backups/hardware.txt +getconf hardwarefile $parentdir/hardware.txt getconf sysreport yes -getconf sysreportfile /var/backups/sysreport.txt +getconf sysreportfile $parentdir/sysreport.txt getconf SFDISK `which sfdisk` 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 @@ -85,10 +98,10 @@ 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 ? - $VSERVERINFO -q $vserver RUNNING + vservers_running $vserver if [ $? -ne 0 ]; then warning "The vserver $vserver is not running." continue @@ -269,9 +282,6 @@ for x in $(/sbin/lsmod | /bin/cut -f1 -d" " 2>/dev/null | /bin/grep -v Module 2 catifexec "/sbin/modinfo $x" done -STATUS="Currently getting ksysms information:" -catifexec "/sbin/ksyms" - STATUS="Gathering information about your filesystems:" catiffile "/proc/filesystems" @@ -282,7 +292,7 @@ STATUS="Gathering information about your partitions:" catiffile "/proc/partitions" STATUS="Gathering information about your ksyms:" -catiffile "/proc/ksyms" +catiffile "/proc/kallsyms" STATUS="Gathering information about slabinfo:" catiffile "/proc/slabinfo"