Sync iTunes library to USB flash drive?

What you might find @ChrisSU, is that there are a load of extra marker files that have a fullstops at the beginning of a filename, and this can look a mess when you are browsing. If it helps, below is a script you can use which will look to see if you have inserted a USB drive called either CARMUSIC KITCHEN or NAIM, and then syncs the folder “/Users/Shared/Music” to that USB stick. Your folder will be different of course, so just amend line 3 accordingly. The advantage of the script is the tidy it does at the end to remove the majority of those extra files.

Copy the following into a file called say “SyncUSBMusic.sh”, and then open it with the App Terminal. Any Problems, let me know.

#! /bin/sh
cd
MusicFolder="/Users/Shared/Music MP3"
for USBMusicPartitionName in CARMUSIC KITCHEN NAIM
do
if test -d /Volumes/$USBMusicPartitionName
then
mdutil -i off /Volumes/$USBMusicPartitionName
echo Syncing Music from ${MusicFolder}  to /Volumes/$USBMusicPartitionName . . .
rsync -rltv -u --modify-window=1 --delete  "${MusicFolder}/" "/Volumes/$USBMusicPartitionName/"
echo Tidy Up
cd /Volumes/$USBMusicPartitionName
find /Volumes/$USBMusicPartitionName -type d -empty -exec rm -r {} \;
rm -rf /Volumes/$USBMusicPartitionName/.fseventsd
rm -rf /Volumes/$USBMusicPartitionName/.DS_Store
rm -rf /Volumes/$USBMusicPartitionName/.Trashes
rm -rf /Volumes/$USBMusicPartitionName/._.Trashes
rm -rf tmp1
mkdir /Volumes/$USBMusicPartitionName/.fseventsd
touch /Volumes/$USBMusicPartitionName/.fseventsd/no_log 
touch /Volumes/$USBMusicPartitionName/.metadata_never_index 
touch /Volumes/$USBMusicPartitionName/.Trashes
find /Volumes/$USBMusicPartitionName/ -name ".DS_Store" -depth -exec rm {} \;
cd /Volumes
else
echo $USBMusicPartitionName not mounted
fi
done