My linux server uses podget to download podcasts.
The downloaded podcasts are picked up using rsync by my Asus WL-520GU / OpenWRT based car audio player.
The Asus WL-520GU uses an 8GB USB stick for storage so care is needed to ensure that downloaded podcasts are cleaned up.
I went with the approach of keeping only the most recent copy of each subscribed podcast.
While podget has a facility to cleanup old podcasts this is time based and did not always seem to work for my subscriptions.
Instead to solve the problem I created a shell script which is run on the linux server immediately after the podget process completes.
# Remove playlist files
# Remove all but the most recent podcast in each subfolder
for directory in `find . -type d \( ! -iname ".*" \)`; do
find $directory -maxdepth 1 -type f -printf "%T@\t%p\n" | sort -k1,1n | cut -f2- | sed '$d' | tr '\n' '\0' | xargs -r0 rm -f
On the ASUS WL-520GU the rsync process is run with the --delete flag to ensure files that no longer exist on the server are deleted from the ASUS.