Time for action – enhancing the backup script
- Open the
backupCacti.sh
script and add the following line between theFILENAME
andBACKUPDIR
line:TGZFILENAME="cacti_files_$DATE.tgz";
- Add the following two lines at the end of the script:
# Create the Cacti files backup tar -czpf $BACKUPDIR$TGZFILENAME ./etc/cron.d/cacti ./etc/php.ini ./etc/php.d ./etc/httpd/conf ./etc/httpd/conf.d ./etc/spine.conf ./usr/local/spine ./var/www/html/cacti ./var/www/html/cacti-0.8.7g
- Remove any earlier backups from the backup directory:
rm /backup/cacti_*
- Start the backup script:
/bin/bash /backup/backupCacti.sh
- Verify whether the database and the files backup have been created:
ls –l /backup
What just happened?
You have enhanced the script to also create a backup ...
Get Cacti 0.8 Beginner's Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.