diff --git a/roles/backup/files/dump-megaraid-cfg b/roles/backup/files/dump-megaraid-cfg index ebd0fd6..9cef7bf 100644 --- a/roles/backup/files/dump-megaraid-cfg +++ b/roles/backup/files/dump-megaraid-cfg @@ -18,7 +18,10 @@ if (-x '/opt/MegaRAID/MegaCli/MegaCli64'){ $megacli = '/opt/MegaRAID/MegaCli/MegaCli'; } -exit (0) unless($megacli); +if (!$megacli){ + print "MegaCli not installed, nothing to do\n"; + exit 0; +} my $adapters = 0; foreach (qx($megacli -adpCount -NoLog)) { @@ -42,6 +45,7 @@ foreach my $adp (0..$adapters-1){ next if ($hba && $failgrouplist); # Save the config in binary format + print "Saving config for adapter $adp\n"; qx($megacli -CfgSave -f /home/lbkp/megaraid/cfg_$adp.bin -a$adp -NoLog); die "Failed to backup conf for adapter $adp\n" unless ($? == 0); diff --git a/roles/backup/files/post-backup b/roles/backup/files/post-backup index 655ba45..4b55acc 100644 --- a/roles/backup/files/post-backup +++ b/roles/backup/files/post-backup @@ -2,7 +2,13 @@ if [ -d "/etc/backup/post.d" ]; then for H in $(find /etc/backup/post.d -type f -o -type l | sort); do - [ -x $H ] && $H "$@" + if [ -x $H ]; then + echo "Running hook $H" + $H "$@" + echo "Finished hook $H" + else + echo "Skiping hook $H as it's not executable" + fi done fi # Remove the lock diff --git a/roles/backup/files/pre-backup b/roles/backup/files/pre-backup index 82a5e44..78a8969 100644 --- a/roles/backup/files/pre-backup +++ b/roles/backup/files/pre-backup @@ -24,6 +24,12 @@ fi touch /var/lock/bkp.lock if [ -d "/etc/backup/pre.d" ]; then for H in $(find /etc/backup/pre.d -type f -o -type l | sort); do - [ -x $H ] && $H "$@" + if [ -x $H ]; then + echo "Running hook $H" + $H "$@" + echo "Finished hook $H" + else + echo "Skiping hook $H as it's not executable" + fi done fi