Skip to content

Instantly share code, notes, and snippets.

@v-thomp4
Created September 12, 2018 07:26
Show Gist options
  • Save v-thomp4/62772d70ae4702deebd8253fe1eeb6fd to your computer and use it in GitHub Desktop.
Save v-thomp4/62772d70ae4702deebd8253fe1eeb6fd to your computer and use it in GitHub Desktop.
CLEAN UP WHISPER DATABASE
1. Delete old metrics of ours that haven't been written to for over 90 days
# just to satisfy my curiosity: how much disk space I will gain
find /data/db/whisper/ -name "*wsp" -mtime +90 -exec echo -n -e {}"\0" \; | du -hc --files0-from=-
# delete the files!
find /data/db/whisper/ -type f -mtime +90 -name "*wsp" -exec rm '{}' \;
2. Delete empty directories
# how many do we have?
find /data/db/whisper/ -type d -empty | wc -l
# remove them!
find /data/db/whisper/ -type d -empty -delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment