Ad Widget

Collapse

Backup script for Zabbix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SouperGrover
    Junior Member
    • May 2013
    • 22

    #1

    Backup script for Zabbix

    Wanted to share a script I wrote for backing up a Zabbix server. It grabs the Zabbix db, config files, and log files, TARs them and transfers the file to a remote windows host for backup. I run this as a cron job every night. In the future I may add a routine to clean up the remote backup folder after a set amount of time (so it will only keep - say - 30 days worth of backups.

    Enjoy!

    Description This script backups up the Zabbix database, config files and logs and offloads them to a remote windows share. I run this as a cron job every night Source Code NOW=$(date +"%Y-%m-%d") CONFIG_DIR="/etc" USERPARAMS_DIR="/etc/zabbix_agentd.userparams.conf" LOGS_DIR="/var/log/zabbix" BACKUP_DIR="/tmp/zabbix_backups" ZABBIX_DB="zabbix" REMOTE_DIR="//winserver/share/backups/zabbix" REMOTE_DIR_MOUNT="/mnt/remote_backup" echo "Backing up database. This may take a while..." mysqldump $ZABBI...


    P.S. I'm running an appliance install, so I am not sure where all of the config files may be on a true install. Modify as needed
Working...