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

VN:F [1.9.11_1134]
Rate this post:
Rating: 0.0/10 (0 votes cast)

:, ,

Leave a Reply

Bad Behavior has blocked 1177 access attempts in the last 7 days.

© 2009-2012 Chris Kranz All Rights Reserved
This site is not affiliated or sponsored in anyway by NetApp or any other company mentioned within.