Best Practices for Cacti Backups

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
tophercer
Posts: 4
Joined: Thu Oct 22, 2020 11:55 am

Best Practices for Cacti Backups

Post by tophercer »

Hello all,

I am trying to set up automated backups of my database, but I'm not sure what the best practice is. My current plan is to make a script that will pause the poller and mysql, then use tar to make a copy of these two directories, which I'll then ftp offsite:
/var/lib/mysql/
/var/www/html/cacti/

Would that be sufficient? I thought I had sufficient backups in the past, but I had missed the ibdata1 table, so I'm now just doing the entire mysql directory.

Separately, what is the most graceful way to halt cacti and mysql via command line so that I can make a stable backup? My understanding is that trying to copy those folders while the poller is running will cause corruption in my backup. I assume just stopping the mysqld service isn't ideal.

I'm sorry if this is a redundant post. I searched the forums and found a post referencing a pre-2006 discussion page about this, but I wasn't able to actually find the discussion.

Thank you!
Chris
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Best Practices for Cacti Backups

Post by netniV »

Depending on your flavour of linux... you could stop the poller, create a clone / snapshot of the disk, which you can then use to backup the relevant data so it doesn't change as you backup. This would also allow you to catch the MySQL databases and RRD files, all of which are used to make Cacti work.

As for your location paths, well that depends on the OS you are using, whether you've done a manual install or package install etc.

Just remember that the three main things are Cacti Website (sources), RRD files (data), MySQL (cacti configuration, device lists, etc).

If you are running as a VM, would be better to snapshot the whole machine.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests