Skip to content

Instantly share code, notes, and snippets.

@nicoulaj
Created August 7, 2012 15:08
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nicoulaj/3286172 to your computer and use it in GitHub Desktop.
Save nicoulaj/3286172 to your computer and use it in GitHub Desktop.
Clean Java hsperfdata files
#!/bin/sh
# Looks for /tmp/hsperfdata_* files leaved by unclean Java processes
# shutdowns and remove them.
# This should be executed by a user without sufficient rights to delete
# other users files...
for hsperfdata in /tmp/hsperfdata_*/*; do
ps -p `basename ${hsperfdata}` &> /dev/null || rm -vf $hsperfdata
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment