"Run a shell script" appears not to work in OSX 10.8.

Ted Bially's Avatar

Ted Bially

28 Jul, 2012 11:10 PM

I use the "Run a shell script" feature upon completion of a scheduled task. This has always worked perfectly in Lion, but doesn't work at all in Mountain Lion. The scripts execute properly when invoked via the Terminal or called from an AppleScript file. Any hints?

  1. Support Staff 2 Posted by Mike Bombich on 30 Jul, 2012 04:52 AM

    Mike Bombich's Avatar

    Hi Ted:

    Do you get an error, or does CCC not report running the script at all? Can you submit your logs to me for review? The easiest way to do this is from within CCC:

    1. Choose "Report a problem" from the Help menu
    2. Click on the "Submit Logs" tab and review the information presented
    3. Click on the "Submit Logs" button
    4. Update this discussion to let us know that you've submitted your logs, and please note the submission ID at the bottom of the Submit Logs tab.

    I have tested that functionality on Mountain Lion, I expect it to work just fine.

    Thanks,
    Mike

  2. 3 Posted by Ted Bially on 30 Jul, 2012 04:44 PM

    Ted Bially's Avatar

    Mike,

    I've come to believe the problem may not be with CCC. After upgrading to Mountain Lion some of my other shell scripts no longer perform properly when invoked from AppleScript, but they work OK when entered directly as command lines in the Terminal. So the problem clearly isn't localized to CCC. My shell scripting skills are minimal, so it may be that Mountain Lion is less tolerant of amateurish scripts than Lion was.

    By the way, CCC does OK with other shell scripts, but there's only one that hasn't worked since I upgraded to Mountain Lion. It's a very simple script:

    Here's the log file for this item:

    Again, this may not be a CCC problem, so you probably shouldn't spend too much time on it!

    Thanks for your help!
    Ted

    On Jul 30, 2012, at 12:52 AM, Mike Bombich <[email blocked]> wrote:

    > **** PLEASE REPLY ABOVE THIS LINE ****
    > **** Any part of your response that is below this line will be discarded ****

  3. Support Staff 4 Posted by Mike Bombich on 30 Jul, 2012 07:20 PM

    Mike Bombich's Avatar

    Hi Ted:

    It's funny how much I'm seeing this one now that CCC 3.5 is out. The issue here is that there was a bug in earlier versions of CCC in which CCC wasn't complaining about the source volume disappearing. The solution is to make a small tweak to your postflight shell script:

    #!/bin/sh
    (sleep 5; diskutil unmount /Volumes/'Windows HD'/ >> /Library/Logs/CCC.log 2>&1 ) &
    

    Adding a small delay to the task and sending the unmount request to the background allows CCC to finish its work. Once CCC has declared the task complete, it won't see the source volume's disappearance as something to complain about.

    Let me know if that change doesn't fix the problem.

    Mike

  4. 5 Posted by Ted Bially on 30 Jul, 2012 07:52 PM

    Ted Bially's Avatar

    That did it! Thanks, Mike. Much appreciated!

    On Jul 30, 2012, at 3:20 PM, "Mike Bombich" <[email blocked]> wrote:

    > **** PLEASE REPLY ABOVE THIS LINE ****
    > **** Any part of your response that is below this line will be discarded ****

  5. Mike Bombich closed this discussion on 30 Jul, 2012 07:54 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac