-
-
Save addisonj/6586817 to your computer and use it in GitHub Desktop.
Checks all the wsp files in a whisper storage and deletes any corrupt files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
matches=() | |
directory='/opt/graphite/storage/whisper' | |
for file in $(find $directory -type f -name '*.wsp' -print); do | |
$(python /usr/local/bin/whisper-info.py $file > /dev/null 2>&1) | |
retval=$? | |
echo "checking $file" | |
[ $retval -ne 0 ] && matches+=($file) | |
done | |
echo "deleting ${#matches[@]} corrupt files:" | |
for file in "${matches[@]}"; do | |
sudo rm $file && echo -e "- $file" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment