Apple Event: May 7th at 7 am PT

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

I'm unable to copy files using rsync through shell with automator

I'm unable to copy files using rsync through run shell with automator but it will work if I play the workflow from within the automator editor. I'm using BigSur but have the same results building it from scratch in Catalina.


I've tried various methods of running the script. such as using apple script applet, automator and terminal. It runs fine pasted into a terminal window but this isn't what I can use since I want to run a script file so that Calendar can run it at a set time. This work with using a third party FTP which I don't want to use for "reasons".


Up to this point the script has successfully logged in and mounted a read only FTP directory. The directory itself is not read only but Finder mounts it as such. I have the workflow wait to give the previous step to complete in event of connection slowing it. then it runs rsync to copy files from an FTP directory to a local directory. Followed by a notification upon completion.


I have played around quite a bit with the script in a test scenario and done lots of reading including the manual. Can anyone see if there is a code error causing this? Operation not permitted is weird since it works inside automator and terminal and my login has read and write authorisation. Is it an Administrator thing? My user on the Mac is administrator. Also the mounted FTP connection is fully navigable with Finder and I can manually copy the files by drag and drop.


I run this:


rsync -ahPEu --delete --exclude=".*/" "/Volumes/server.com/public_html/test/" "/Users/NAME/Downloads/test"


and I get this error. (as stated it will work fine if I click the play button within automators editor or paste it into a terminal window):


The action “Run Shell Script” encountered an error: “rsync: opendir "/Volumes/server.com/public_html/test/." failed: Operation not permitted (1)


rsync: failed to set times on "/Users/NAME/Downloads/test/.": Operation not permitted (1)


send_files failed to open "/tmp/.._..Q2WsCA": Operation not permitted


rsync: failed to set times on "/Users/NAME/Downloads/test/.": Operation not permitted (1)


rsync error: some files could not be transferred (code 23) at /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-55/rsync/main.c(996) [sender=2.6.9]”


Appreciate any help or advice.

iMac with Retina 5K display, macOS 11.0

Posted on Aug 26, 2020 11:53 PM

Reply
Question marked as Best reply

Posted on Aug 27, 2020 12:11 AM

OK I just realised the issue. I had to manually add the automator workflow to "Full Disk Access". Weird though; I was not asked by the system to do this. Most of the script executed just fine without it. Other work flows asked me for the permission. Automator has been given access previously. Well at least that is solved.

Similar questions

1 reply
Question marked as Best reply

Aug 27, 2020 12:11 AM in response to osihara

OK I just realised the issue. I had to manually add the automator workflow to "Full Disk Access". Weird though; I was not asked by the system to do this. Most of the script executed just fine without it. Other work flows asked me for the permission. Automator has been given access previously. Well at least that is solved.

I'm unable to copy files using rsync through shell with automator

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