July 25, 2004
Delete reworked
I've revamped the way that "deleting" songs works on NewMusicRadio. Now the "deleted" songs are just added to a list of files to exclude, and the original files are left as-is.
This means that:
- The
$deleteFilteris deprecated because none of the mp3 files are actually harmed when "deleted" - I can decide I don't like tracks that came on CDs without ending up with random tracks in my music collection being deleted (even if they aren't tracks I like)
- Most importantly, you don't need the
--ignore-lengthswitch onwgetanymore - You also don't need the
chmod g+wbecause the script doesn't have to overwrite files
I've added a few lines of statistics output to my cron script because I'm curious as to how many files drop off the list as "too old" each day, and how many new files are added. These are the extra find and wc lines.
The final big change is with the line:
find /home/tunes/downloads/ -name \*.mp3 -mtime +42 -exec rm {} \;
This deletes any mp3s older than 42 days in the directory /home/tunes/downloads/ (or any directories below that). In detail:
/home/tunes/downloads/this is the directory where all my downloaded (mp3 blogs and Soulseek) mp3s live-name \*.mp3find should only look for files called <something>.mp3-mtime +42only look for files older than 42 days. The + is important, -42 means look for files younger than 42 days-exec rm {} \;for each file found, perform anrm <filename>;to delete it
There's still more to play with to link the mp3s downloaded from mp3 blogs to their source, but I think the bare bones of it are now working correctly.
Posted by Adrian at July 25, 2004 09:24 PM | TrackBackFeel less stressed. Get more done. tedium, a website developed by my company, MCQN Ltd will help you do just that.
DataCocoon is the easy-to-use, automated, off-site backup software developed by my company, MCQN Ltd.