#!/bin/bash # Zenoss 5 backup script # # # CHANGE THESE VARIABLES # Zenoss 5 Backup log file log="/root/zenbackup.log" # Backup directory bdir="/backup/zenbackup/" echo "Starting Zenoss backup Script" echo "Starting backup to ${bdir}." $(date) >> ${log} echo "Starting Backup to ${bdir}." $(date) # Stop Zenoss Service serviced service stop Zenoss.core wait # Wait for Zenoss to stop and then continue the backup while [ -ne `serviced service status Zenoss.core | grep Stopped` ] do echo "Waiting for Zenoss to Stop" sleep 5 done # Backup echo "Starting Zenoss Backup" serviced backup ${bdir} echo "Backup Finished" wait # Start Zenoss echo "Starting Zenoss" serviced service start Zenoss.core echo "Finished backup." $(date) >> ${log} echo "Finished backup." $(date) exit