d=`date \`\`+%y-%m-%d''` x=`mkdir -p ~/Backup/proteus/$d` if `test ! -d ~/Backup/proteus/$d` then echo "Error creating backup directory occured." echo "Cannot back up proteus logs." exit $x fi echo "Backup directory created successfully." echo "Moving files..." c=`ls ~/Library/Application\ Support/Instant\ Messaging/Profile/History\ XML/ | wc -l | sed "s/ //g"` if [[ $c == "0" ]] then echo "No files to backup." exit 0 else mv ~/Library/Application\ Support/Instant\ Messaging/Profile/History\ XML/*.gz ~/Backup/proteus/$d echo "Backup complete" echo "You can find the files at ~/Backup/proteus/$d." fi exit 0