Mar 24, '05 09:43:00AM • Contributed by: tmcintir
Here's the podsync.sh script -- I put mine in ~/Podsync:
#!/bin/sh
cd ~/Podsync
ls ~/Music/Podcast/*.mp3 > current.tmp
echo ""
echo "Podsync"
echo "---"
i=1
scount=0
ccount=0
while [ 1 ]
do
entry=`awk '(NR=='$i') {printf $1}' ./current.tmp`
if test "$entry" = ""
then
break
fi
echo "$i: $entry"
check=`grep $entry ./copied.tmp`
if test "$check" = ""
then
cp $entry /Volumes/SDCARD/AUDIO/.
echo "COPIED"
echo $entry >> copied.tmp
ccount=`expr $ccount + 1`
else
scount=`expr $scount + 1`
echo "SKIPPED"
fi
i=`expr $i + 1`
done
echo "---"
echo "$ccount items copied, $scount items skipped."
hdiutil unmount /Volumes/SDCARD/
echo ""
For those who don't know, ~ is your home directory (i.e. /Users/YOURUSERNAME). Change ~/Music/Podcast to the name of the folder where you keep your podcasts and /Volumes/SDCARD to the /Volumes/USB_mount_location. Also, don't forget to type chmod +x podsync.sh before you use your script for the first time, so it will be executable.
