Quantcast
Viewing all articles
Browse latest Browse all 232869

Re: Deleting historical vmware-*.log files

If you use PowerCLI you could do something like this:

 

Get-DataStore ESX02_LOCAL2 | New-DataStoreDrive -Name DS
cd DS:
Get-ChildItem -Recurse | where {$_.Name -like "vmware-*.log"}
Remove-PSDrive -Name DS

 

If you're happy with the files that are found you would just change the one line to this to delete the files:

 

Get-ChildItem -Recurse | where {$_.Name -like "vmware-*.log"} | foreach ($_) {remove-item $_.fullname}

 

If you're connected to a console or SSH session and just need a one time run you could run this to list the files

 

find /vmfs/volumes/ -name vmware-*.log  -exec ls  {} \;

 

and this to delete the files

 

find /vmfs/volumes/ -name vmware-*.log  -exec ls  {} \; | xargs rm


Viewing all articles
Browse latest Browse all 232869

Trending Articles