Hello,
Thanks for this utility. It is really useful.
I am using the script and have not had any success in limiting the number of retained backups. This ends up filling up my backup disk (a NAS drive mounted via NFS), so I need to figure out how to resolve it. Here is an example of the command I am using via cron job:
30 1 * * * /usr/local/bin/virt-back --quiet --backup --date --retention=2 -p /vmimages1/backups scre-ubuntu-log
The retention flag is being ignored. (Currently there are 4 backups stored, and if I don't delete them manually, they will stay there.) I am not seeing anything about the rotation in the logfile/syslog:
Sep 3 01:30:01 535-1201a-vm9 CRON[4486]: (root) CMD (/usr/local/bin/virt-back --quiet --backup --date --retention=2 -p /vmimages1/backups scre-ubuntu-log) Sep 3 01:30:02 535-1201a-vm9 virt-back: invoking shutdown on scre-ubuntu-log Sep 3 01:30:02 535-1201a-vm9 virt-back: waited 0 seconds for scre-ubuntu-log to shut off Sep 3 01:30:12 535-1201a-vm9 virt-back: waited 10 seconds for scre-ubuntu-log to shut off Sep 3 01:30:22 535-1201a-vm9 virt-back: waited 20 seconds for scre-ubuntu-log to shut off Sep 3 01:30:32 535-1201a-vm9 virt-back: waited 30 seconds for scre-ubuntu-log to shut off Sep 3 01:30:42 535-1201a-vm9 virt-back: waited 40 seconds for scre-ubuntu-log to shut off Sep 3 01:30:52 535-1201a-vm9 virt-back: waited 50 seconds for scre-ubuntu-log to shut off Sep 3 01:31:02 535-1201a-vm9 virt-back: invoking backup for scre-ubuntu-log Sep 3 01:31:02 535-1201a-vm9 virt-back: copying /vmimages1/img/scre-ubuntu-log.vmdk to /vmimages1/backups/scre-ubuntu-log.vmdk for scre-ubuntu-log Sep 3 01:32:46 535-1201a-vm9 virt-back: invoking create on scre-ubuntu-log Sep 3 01:32:50 535-1201a-vm9 virt-back: archiving files for scre-ubuntu-log to /vmimages1/backups/scre-ubuntu-log-2014-09-03.tar.gz Sep 3 01:32:50 535-1201a-vm9 virt-back: archiving /vmimages1/backups/scre-ubuntu-log.xml for scre-ubuntu-log Sep 3 01:32:50 535-1201a-vm9 virt-back: archiving /vmimages1/backups/scre-ubuntu-log.vmdk for scre-ubuntu-log Sep 3 01:52:58 535-1201a-vm9 virt-back: finished backup for scre-ubuntu-log
I would appreciate your help in resolving this. Thanks for this great utility.
Comments
Hey Jennifer,
Just a guess but I don't think the way I wrote the retention will work with the
--dateoption. This is because the filenames are always unique. You must choose either to put dates into your filenames and find a different way to perform rotations, or use the--retentionflag and letvirt-backrotate the files.OK, thanks, I'll try removing the date option and see if retention works then. Thanks for the quick reply. Will let you know if that works.
Removing the --date option worked. Thanks!