Skip to content

Instantly share code, notes, and snippets.

@ruuda
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ruuda/4f5dff7a850e2984d409 to your computer and use it in GitHub Desktop.
Save ruuda/4f5dff7a850e2984d409 to your computer and use it in GitHub Desktop.
Scrub flac music collection
#!/bin/sh
# Timestamp starting the scrub.
echo -n 'initiating scrub at ' >> scrub.log
date >> scrub.log
# Enumerate all flac files, run `flac -tsw` (test silent, warning as error) on it,
# and output the filename to scrub.log if it fails.
find /path/to/music -type f -name '*.flac' | while read file; do
flac -tsw "$file" || echo "$file" >> scrub.log
done
# And timestamp when it was done.
echo -n 'scrub done at ' >> scrub.log
date >> scrub.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment