Page 1 of 1
nagios backup script question
Posted: Mon Jul 08, 2013 12:52 pm
by benhank
Hello all!
What do I need to do to make the nagios backup script use regular time instead of unix time?
And would I have to make any changes to the restore script?
(stop laffin..)
Re: nagios backup script question
Posted: Mon Jul 08, 2013 1:29 pm
by abrist
Copy the script first as XI upgrades will overwrite it (DISCLAIMER - When we change the script for necessary upgrades, you will have to reapply the following, assuming the following will still work):
Code: Select all
cp /usr/local/nagiosxi/scripts/backup_xi.sh /usr/local/nagiosxi/scripts/backup_xi_benhank_style.sh
On line 110 of the script backup_xi_benhank_style.sh, add the following:
Code: Select all
bhts=$(date +"%m-%d-%y")
mv $ts.tar.gz "$bhts".tar.gz
echo "Backup is actually stored in $rootdir/$bhts.tar.gz"
echo "*Not* where the script will tell you it is below, it lies!"
bhts = benhank timestamp or better human timestamp
As always, give it a test. The restore procedure should work as it grabs the filename passed to it and loads it into a variable. As there are no spaces in this name, it should work ok, though it does not include hours, minutes, etc. Let me know if you have issues with it.
Re: nagios backup script question
Posted: Mon Jul 08, 2013 2:06 pm
by benhank
bhts = benhank timestamp or better human timestamp

As they day in the shaft song" You >censored< riiiight!"
thanks you can lock it up. =D
Re: nagios backup script question
Posted: Mon Jul 08, 2013 2:22 pm
by abrist
THEN WE CAN DIG IT!