Skip to content

Instantly share code, notes, and snippets.

@larsvegas
Last active December 20, 2015 22:29
Show Gist options
  • Save larsvegas/6205421 to your computer and use it in GitHub Desktop.
Save larsvegas/6205421 to your computer and use it in GitHub Desktop.
aws ec2 runs out of disk space due to open file descriptors on deleted files like at http://serverfault.com/questions/454194/disk-space-keeps-filling-up-on-ec2-instance-with-no-apperent-files-directories. Kill it.
#!/bin/sh
sudo lsof | grep deleted | awk '{print $2}' | grep -v 1 | xargs sudo kill -USR1
@zeisss
Copy link

zeisss commented Aug 12, 2013

the loop could be replaced with xargs ;)

@larsvegas
Copy link
Author

@zeisss thanks, i rewrote it with the help of @janpieper ...

@larsvegas
Copy link
Author

using kill -USR1 seems like to work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment