Q: rsync apple script syntax error - help please :]
Hi all
Im having difficulty with my rsync syntax.
I want to write a script that backs up folders from my 'home' folder.
The rsync works perfectly in terminal.
I just cant get it to work in applescript.
I get error - Expected “"” but found unknown token.
Id really really appreciate it if someone could help me out here and show me whats wrong with the syntax.
tell application "Finder"
activate
do shell script "rsync -ruv --exclude-from=/Volumes/John\'s\ Stuff/john/Rsync/Exclude\ from\ Media\ Storage.txt /Volumes/John\'s\ Stuff/john /Volumes/Media\ Storage\ 1 "
end tell
display dialog "Backup complete, Do you want to eject the disk?"
if result = {button returned:"Ok"} then
try
do shell script "diskutil eject /Volumes/Media*Storage*1"
display dialog "Successfully ejected the disk." buttons {"Close"} default button "Close"
on error
display dialog "Unable to eject the disk." buttons {"Close"} default button "Close"
end try
else if result = {button returned:"Cancel"} then
end if
end
OS X Yosemite (10.10.3), null
Posted on Jun 14, 2015 10:23 AM
You need to put a second backslash next to each existing one to escape them:
do shell script "rsync -ruv --exclude-from=/Volumes/John\\'s\\ Stuff/john/Rsync/Exclude\\ from\\ Media\\ Storage.txt /Volumes/John\\'s\\ Stuff/john /Volumes/Media\\ Storage\\ 1 "
(128759)
Posted on Jun 14, 2015 10:23 AM