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