#!/bin/bash # Script to clean up podcasts using only files which have been downloaded. # Data Directory from bashpodder.shell file datadir=$(grep datadir= bashpodder.shell | sed -e 's/d.*=//g') # days to keep podcasts days=14 # parse podcast names from podcast.log, then check to see if any are older # than the number of days specified above. casts=$(sed -e 's/^http.*[/]//g' podcast.log) for cast in $casts do find 2>/dev/null $datadir/$cast -ctime +$days | xargs rm -f done