do_wget bugfix

Posted on May 23, 2007 by Steve

No updates lately because the wget script was not behaving well. Since May 2005, 2347 mp3 filenames have accumulated in the shells folder. Most of these are empty files which are retained to prevent wget from grabbing new copies of previously downloaded files. This number of files was enough to cause an "Argument list too long" error when the script runs and tries to loop through the files. While recompiling the kernel is one suggested solution, I opted to replace my unweildy ls/awk combination with an elegant find.

Before:
for files in `ls -clt $workingdir\shells/*mp3 |
awk '{if ($5 > 1) print substr($0, index($0, $9))}'`

After:
for files in `find $workingdir\shells/ -type f -name '*mp3' -size +1`

Besides being more concise and clear, and working, this also is better for not depending on the order of the columns returned by ls -l.

There's a backlog of 127 mp3 files to be audited, and hopefully something worth posting will be among them.
« Prev itemNext item »

Comments

No one has put a bit in.

Leave comment

You must be logged in as a member to add comment to this blog