#!/bin/csh -f #NOTE! I have abandoned the mp3idx* scripts in favor of the MySQL based mp3db and #trackerdb scripts. This script is old and lame. cd /mp3 || exec echo "/mp3 not found." echo "Finding all mp3 files..." find . -name "*.mp3" -print | sed -e 's/^\.\///' | sort > /tmp/allmp3.txt echo "Finding all new (last 60 days) mp3 files..." find . -type f -name "*.mp3" -mtime -60 -print | sed -e 's/^\.\///' | sort > /tmp/recent60.txt echo "Finding all new (last 30 days) mp3 files..." find . -type f -name "*.mp3" -mtime -30 -print | sed -e 's/^\.\///' | sort > /tmp/recent30.txt echo "Finding all new (last 7 days) mp3 files..." find . -type f -name "*.mp3" -mtime -7 -print | sed -e 's/^\.\///' | sort > /tmp/recent7.txt echo "Finding all new (last 1 days) mp3 files..." find . -type f -name "*.mp3" -mtime -1 -print | sed -e 's/^\.\///' | sort > /tmp/today.txt echo "Finding all ogg files..." find . -name "*.ogg" -print | sed -e 's/^\.\///' | sort > /tmp/allogg.txt echo "Finding all new (last 60 days) ogg files..." find . -type f -name "*.ogg" -mtime -60 -print | sed -e 's/^\.\///' | sort >> /tmp/recent60.txt echo "Finding all new (last 30 days) ogg files..." find . -type f -name "*.ogg" -mtime -30 -print | sed -e 's/^\.\///' | sort >> /tmp/recent30.txt echo "Finding all new (last 7 days) ogg files..." find . -type f -name "*.ogg" -mtime -7 -print | sed -e 's/^\.\///' | sort >> /tmp/recent7.txt echo "Finding all new (last 1 days) ogg files..." find . -type f -name "*.ogg" -mtime -1 -print | sed -e 's/^\.\///' | sort >> /tmp/today.txt echo "Finding all tracker files..." find ./tracker -type f -print | sed -e 's/^\.\///' | sort > /tmp/alltrack.txt echo "Finding all new (last 60 days) tracker files..." find ./tracker -type f -mtime -60 -print | sed -e 's/^\.\///' | sort >> /tmp/recent60.txt echo "Finding all new (last 30 days) tracker files..." find ./tracker -type f -mtime -30 -print | sed -e 's/^\.\///' | sort >> /tmp/recent30.txt echo "Finding all new (last 7 days) tracker files..." find ./tracker -type f -mtime -7 -print | sed -e 's/^\.\///' | sort >> /tmp/recent7.txt echo "Finding all new (last 1 days) tracker files..." find ./tracker -type f -mtime -1 -print | sed -e 's/^\.\///' | sort >> /tmp/today.txt echo "Sortting..." cat /tmp/allmp3.txt /tmp/allogg.txt /tmp/alltrack.txt | sort > allfiles.txt echo "Correcting path..." cat allfiles.txt | sed -e 's/\//\\/g' > allfiles.asc echo "Making w_all list..." awk -F~ '{print "W\:\\" $1 $2}' allfiles.asc > /mp3/playlists/w_all.m3u echo "Making allfiles playlist..." awk -F~ '{print "/mp3/" $1 $2 $3 $4 $5}' allfiles.txt > /mp3/playlists/allfiles.m3u echo "Making recent60 playlist..." awk -F~ '{print "/mp3/" $1 $2 $3 $4 $5}' /tmp/recent60.txt > /mp3/playlists/recent60.m3u echo "Making recent30 playlist..." awk -F~ '{print "/mp3/" $1 $2 $3 $4 $5}' /tmp/recent30.txt > /mp3/playlists/recent30.m3u echo "Making recent7 playlist..." awk -F~ '{print "/mp3/" $1 $2 $3 $4 $5}' /tmp/recent7.txt > /mp3/playlists/recent7.m3u echo "Making today playlist..." awk -F~ '{print "/mp3/" $1 $2 $3 $4 $5}' /tmp/today.txt > /mp3/playlists/today.m3u echo "Making tracker list..." awk -F~ '{print "/mp3/" $1 $2 $3 $4 $5}' allfiles.txt | grep tracker > /mp3/playlists/tracker.m3u echo "Making allmp3 list..." awk -F~ '{print "/mp3/" $1 $2 $3 $4 $5}' allfiles.txt | grep -v tracker > /mp3/playlists/allmp3.m3u echo "Making allogg list..." awk -F~ '{print "/mp3/" $1 $2 $3 $4 $5}' allfiles.txt | grep \.øgg >> /mp3/playlists/allmp3.m3u foreach f (80s alternative classic funny metal misc movies new oldies rock techno ads) echo "Making $f list..." grep ^\/mp3\/$f /mp3/playlists/allmp3.m3u > /mp3/playlists/${f}.m3u end echo "Making html version of allfiles list..." # Call this perl script for the html list. /usr/etc/mp3idx.pl echo "Clearing pics dir..." find /mp3/pics -type l -exec rm -f {} \; echo "Finding all symlinks..." find /mp3 -type l -exec file {} \; | sed -e 's/: symbolic link to / \>\>\> /g' > links.txt echo "Broken links found:" grep broken links.txt echo "Linking .png files..." find /mp3 -path /mp3/pics/.xvpics -prune -or -type f -name "*.png" -exec /mp3/playlists/piclink.csh {} \; > /dev/null echo "Linking .jpg files..." find /mp3 -path /mp3/pics/.xvpics -prune -or -type f -name "*.jpg" -exec /mp3/playlists/piclink.csh {} \; > /dev/null echo "Cleaning up..." rm -f allfiles.asc /tmp/allmp3.txt /tmp/alltrack.txt /tmp/recent*.txt /tmp/allogg.txt /tmp/today.txt echo "done."