Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Checks all the wsp files in a whisper storage and deletes any corrupt files
#!/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
You can’t perform that action at this time.