Virtual Machine Logs
by Chris Kranz on Jan.20, 2009, under Command Line
I hate the VM logs, and in a lot of cases you can end up with thousands of them which are very hard to delete or even browse to the directory. I have this script running on a cron to do a regular clear up. As a matter of course I disable VM logging now, but it can still be a challenge to clear up all the log files.
[root@esx007 root]# cat rm_logs.sh
#!/bin/sh
ls -1F /vmfs/volumes/ | grep @ | cut -d @ -f 1 | while read dir; do
find /vmfs/volumes/${dir}/ -path /vmfs/volumes/${dir}/.snapshot -prune -o -name “vmware-*.log” -print -exec rm -v {} \; ;
done










































