Page 1 of 1

Local backup filename changed

Posted: Thu Sep 22, 2016 6:17 pm
by Naveed
hello,

I want to change the filenames of local backup, I am unable to identify except of date associated with it.

I have tried to checked in script, /usr/local/nagiosxi/scripts/backup_xi.sh, but could not get much from in it.

Kindly guide.

Thank you!

Re: Local backup filename changed

Posted: Fri Sep 23, 2016 10:08 am
by rkennedy
The name is actually based off the time in unix, so to see the furthest backup you have I would look at the lowest number. If you'd like to modify it, this is the part that does the naming -

Code: Select all

#############################
# SET THE NAME & TIME
#############################
name=$fullname

if [ -z $fullname ]; then
        name=$prepend$ts$append
fi

# Get current Unix timestamp as name
if [ -z $name ]; then
        name=$ts
fi

# My working directory
mydir=$rootdir/$name
Otherwise, you can always rename your backups after running the script. mv /store/backups/nagiosxi/#######.tar.gz /store/backups/nagiosxi/yourname.tar.gz

Re: Local backup filename changed

Posted: Fri Sep 23, 2016 3:42 pm
by Naveed
Thank you!

Can I modify my filename with date, I do have a backup file after every 24 hours, so it will be easy for me to check and by filename.

e.g
24092016.tar.gz

Re: Local backup filename changed

Posted: Mon Sep 26, 2016 11:08 am
by rkennedy
This could lead to issue down the road if multiple backups are taken the same day, which is why we used the unix time.

I would leave it as is, or modify it to your needs - but, further modification to the backup script isn't something we can support.

Re: Local backup filename changed

Posted: Mon Sep 26, 2016 8:59 pm
by Naveed
As per you, file is created with univ time, but my files are created as follows.

Can you please explain its format.

Thank you!

Re: Local backup filename changed

Posted: Tue Sep 27, 2016 9:57 am
by rkennedy
See this link for more of an explanation about the unix time stamp - http://www.unixtimestamp.com