Create rotating daily backups
By default zenoss creates daily backups in the $ZENHOME/backup dir.
Here is how to change that and create a rotating system.
if you installed zenoss correctly there should exit a file
/etc/cron.daily/zenoss
This cront script is executed every day in the night.
Now search for this line:
${ZENHOME}/bin/zenbackup -C ${ZENHOME}/etc/zenbackup.conf < /dev/null This is the default zenbackup line.
I advice you to comment this line by placing # in front of the line.
I would like to have a daily backup placed on our NAS.
To do this, I added this after commenting the default line:
destination=/nasdata/zenoss/backups
keepdays=30
${ZENHOME}/bin/zenbackup --file $destination/zenoss-backup-$(date +%d-%m-%Y).tgz -C ${ZENHOME}/etc/zenbackup.conf < /dev/null
find $destination -type f -mtime +$keepdays -name 'zenoss-backup*' -exec rm -f {} \; > /dev/null
This will write the backup to the our nas and name the file to the date.
The second line will search for backups older then the keepdays (in our case 30 days)
If there is an older one the oldest will be deleted.