Local backup filename changed

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Naveed
Posts: 285
Joined: Mon May 30, 2016 10:10 am

Local backup filename changed

Post 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!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Local backup filename changed

Post 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
Former Nagios Employee
Naveed
Posts: 285
Joined: Mon May 30, 2016 10:10 am

Re: Local backup filename changed

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Local backup filename changed

Post 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.
Former Nagios Employee
Naveed
Posts: 285
Joined: Mon May 30, 2016 10:10 am

Re: Local backup filename changed

Post 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!
You do not have the required permissions to view the files attached to this post.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Local backup filename changed

Post by rkennedy »

See this link for more of an explanation about the unix time stamp - http://www.unixtimestamp.com
Former Nagios Employee
Locked