I'm running a Centos 6 physical host with a virtual QEMU KVM Centos 6 machine guest.
E. g. a "Centos inside a Centos".
The KVM file format is a qcow2 file.
I backup by periodically (once a day) stopping the VM and copying the qcow2 file away to another computer. The file is about 24GB in size (when creating the qcow2 file, I set its max size to 100GB).
However, as I use the VM, the file is slowly growing, every day (obviously) as it runs and log files are created, etc. E. g. slowly (but still) the backup is taking longer as the file grows.
How can I keep the size of the file to the minimum? E. g. I already am doing this in a cronjob at night inside the VM to try and keep the disk image size down:
00 23 * * * rm -rf /var/log/samba/*.old
01 23 * * * rm -rf /var/log/boot/log-*
02 23 * * * rm -rf /var/log/cron-*
03 23 * * *rm -rf /var/log/maillog-*
04 23 * * *rm -rf /var/log/messages-*
05 23 * * *rm -rf /var/log/secure-*
06 23 * * *rm -rf /var/log/spooler-*
07 23 * * *rm -rf /var/log/Xorg.*.log.old
08 23 * * *rm -rf /var/log/dmesg.old*
09 23 * * *rm -rf /var/log/audit/audit.log.*
10 23 * * *rm -rf /var/named/data/named.run-*
What else can I do to trim logs / other things to keep the size of the VM as small as possible by having no superfluous log files / text logs being created in the Centos 6 guest?