Automator gets stuck at shell script 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.



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?
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:

&gt;/dev/null 2&gt;&amp;1 &amp;


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 &gt;/dev/null 2&gt;&amp;1 &amp;


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 &gt;/var/log/rsync.log &gt;/dev/null 2&gt;&amp;1 &amp;