1

I am building an automator script to do automatic backups to a network drive via rsync. The shell script works perfectly fine in terminal and completes and everything, but when i run it from automator, it just hangs at that steps and never proceeds, e.g. the process keeps running in the background and the automator workflow never goes to the next step.

Screenshot from Automator (in danish)

I found others with similar problems on other forums, but no answer to how to fix it. Should i add some kind of exit command to the shell script?

  • Is your script missing the password? – Ruskes Jan 7 '15 at 20:29
  • @Buscar웃 No the drive is already mounted. The script runs fine and files are backed up, but it just never "finishes" this step and proceeds to next step. – commonpawn Jan 7 '15 at 21:49
2

I found this link helpful to solve a similar problem I was having:

https://discussions.apple.com/thread/1867978

I tried adding exit 0 to the end of my Automator shell script and it didn't seem to make a difference one way or the other.

After I read the above link I added this to the command in my Automator shell script:

>/dev/null 2>&1 &

It worked great. My Automator shell script now terminates normally.

In the above question, I believe the rsync command could be changed to:

rsync -aovE --delete /Volumes/STORAGE/Batting/Volumes/home/Backup >/dev/null 2>&1 &

If you wanted to log the output from your command, as I did, to a file /var/log/rsync.log then you could modify it to this:

rsync -aovE --delete /Volumes/STORAGE/Batting/Volumes/home/Backup >/var/log/rsync.log >/dev/null 2>&1 &
0

Adding 'exit 0' on line two fixed it

  • 2
    This may be masking an issue with the rsync. It's presumably not continuing on to the next step in your automator flow because rsync exited with a non-zero exit code. This indicates an error occurred in the sync. Adding the exit 0 line forces an error-free exit from the script block no matter what the rsync says. I'd recommend you double check the rsync is actually proceeding okay. – Ian C. Jan 13 '15 at 18:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .