#!/bin/bash

# Sort a hierarchy of files (Podcasts) by date
# bruce@raba.com, 04/18/2005


# Make script crontab friendly:
cd $(dirname $0)

# datadir is the directory you want podcasts saved to:
datadir="$1"

# Get file list
cd "$datadir/.."

find Podcasts -type f ! -name "*.m3u" -exec ls -l --time="ctime" --time-style="+%s" {} \; | awk -F' ' '{print $6,$7}' | sort -rn | awk -F' ' '{print $2}'

