Monday, November 22, 2010

mp3 backup script with rsync

#!/bin/sh


dir="/media/mp3"
ext="mp3"
backupdir="/media/6e6fad14-604b-499f-ac0f-6667aadb478f/MP3S"




find $dir -type f | grep -v \.$ext\$


if [ $? -eq 0 ]
then
echo
echo "Not continuing with backup"
echo "Found non mp3 files"
else


echo "Continuing with backup"
rsync -avur "$dir/" "$backupdir/"
echo "Backup complete"
fi

No comments:

Post a Comment