First, create your list of flac files...
Code:
--------------------
find "$szMusicRoot" -type f -name "*.flac" > /tmp/flacfiles.list
--------------------
Then, create and run the following script, changing the assignment of
seconds_to_run as you see fit. The script will run for the given
number of seconds. It will process one file at a time, and check how
long it has been running after each flac check. You could pass the
number of seconds as an argument to the script.
Code:
--------------------
#!/bin/bash
flac=/usr/bin/flac
filelist=/tmp/flacfiles.list
# set the number of seconds to run
# multiply by 3600 for each hour
(( seconds_to_run= 2 * 3600 ))
echo "Run duration: $seconds_to_run seconds"
echo "Files to process: " $(wc -l $filelist)
while [ -s $filelist -a $SECONDS -lt $seconds_to_run ] ; do
file=$(head -1 $filelist)
if ! $flac -t --totally-silent "$file" ; then
echo $file command here >> bad.files
echo Corrupt: $file
fi
# remove current file from list
sed -i .prev '1d' $filelist
done
--------------------
--
MrC
------------------------------------------------------------------------
MrC's Profile: http://forums.slimdevices.com/member.php?userid=468
View this thread: http://forums.slimdevices.com/showthread.php?t=60307
_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix