Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

rsync Permission Error - Terminal Commands

I'm attempting to setup a script that will search a volume for all files of a specific extension then copy them to a folder that syncs with Dropbox. I'm very close, but am encountering an error.


Below is my script and the error.

rsync --progress -amch --stats --include="*/" --include="*.aep" --exclude="*" "/Volumes/MyName" "/Users/MyName/Dropbox/User Backups/MyName"



Error:

rsync: opendir "/Volumes/MyName/.DocumentRevisions-V100" failed: Permission denied (13)

Mac OS X (10.7.5)

Posted on Nov 13, 2012 12:35 PM

Reply
6 replies

Nov 14, 2012 7:43 AM in response to Andrew Saliga

Apparently the error is non-critical. I've refined the code. Feedback welcome.



echo "Preparing to backup your  data to Dropbox"

dropbox_account='/Users/Home/Dropbox/AdminFiles/User Backups/MyName/'
current_date=`date +%Y%m%d`
backup_path=${dropbox_account}''${current_date}' 

rsync -avmct --stats --human-readable --itemize-changes --log-file="${backup_path}.log" --progress \
--include="*/" --include="*.aep" --include="*.fcp" \
--exclude="*" --exclude=".*" \
"/Volumes/MyName" "${backup_path}"

Nov 14, 2012 9:16 AM in response to Andrew Saliga

Your quoting will get you in trouble. The strong quotes in


dropbox_account='/Users/Home/Dropbox/AdminFiles/User Backups/MyName/'

works but weak quotes would be sufficent.


dropbox_account="/Users/Home/Dropbox/AdminFiles/User Backups/MyName/"


This has unmatched strong quotes that causes an error and ${current_date} or ${dropbox_account} wouldn't expand anyways.


backup_path=${dropbox_account}''${current_date}'

Your best effort would be to avoid file names with spaces if you are using the shell.


backup_path="${dropbox_account}${current_date}"

Nov 14, 2012 1:40 PM in response to Andrew Saliga

Yes, your script looks pretty good. You might want to copy the extended attributes for the fcp and aep files. You could avoid the permissions problems by by-passing the OS X gobbledegoop at the root level of the volume. Narrow rsync's search path by specifying multiple directories on your volume. I'm assuming your shell is bash- you could use braced expansion.


/Volumes/MyName/{SOURCE_ONE,SOURCE_TWO,SOURCE_THREE} "${backup_path}"

rsync Permission Error - Terminal Commands

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.