View Full Version : How to get scripts to run in proper order?

10-11-2008, 02:22 PM

I have three scripts for scheduled copies:

#1 backs up from main internal drive to Time Capsule as sparse image. Initial copy took many hours. Incrementals take less than 30 minutes. Action at end of script is Do Nothing.

#2 backs up from main internal drive to second internal drive. Action at end of script is Do Nothing.

#3 backs up from main internal drive to third internal drive. Action at end of script is Shut Down Computer.

#2 and #3 run every day at 2:35AM and 2:40AM respectively. Everything is normal. On days when #1 runs first, beginning at 2:30AM, it runs for about 25 minutes followed by #3 and then #2. This is my problem. #3 has the Shut Down Computer command at the end of the script. SD! overrides this command to allow #2 to run, but then the computer doesn't shut down. I had hoped that the designated start times would determine the order in which the scripts would run when #1 runs "overtime" but that doesn't seem to be the case. How can I get the scripts to run in proper order?

10-11-2008, 02:39 PM
You know, they generally should run in the order that they're specified (time-wise). I've noted some issues with the queue management and there's a bug reported against that, but I can't tell you when it'll be fixed...

10-11-2008, 02:46 PM
OK. I'll have the Mac do the shutdown for now, but I hope the bug gets fixed. Thanks.

10-14-2008, 01:15 PM
Today was the first day that all three scripts ran since I posted this thread on 10-11-08. I have made no changes since the first post. To my surprise, they ran in order according the their set start times. This is a case of doing the same thing and getting a different result! Go figure...?

10-18-2008, 12:00 PM
This troublesome script runs on Tuesday and Saturday. Last Tuesday, it ran perfectly and in the proper order #1, #2, and #3. Today, Saturday, it ran #1, #3, #2. The shutdown command contained only in #3 was somehow overridden so that #2 could run to completion. The computer then remained on until the set time for shutdown that I had set in the Energy Saver schedule in system preferences. When that time arrived, it shut down. I don't know it this helps your bug chase, but it now appears that the scripts run in order on Tuesdays and not in order on Saturdays. I've made no changes to them since originally setting them up. Tuesday and Saturday are the only days that #1 runs. It updates the SystemImage that is located on Time Capsule's hard drive. It is the only file located on that drive. Time Machine is shut off and is not currently in use. #2 and #3 run in proper order on all other days of the week without a glitch and the shut down command in #3 works. #2 and #3 copy Macintosh HD to second and third internal hard drives respectively (I have a Mac Pro running system 10.5.5 from Sandbox). On those days, the shut down command in system preferences is redundant and doesn't function since the computer is already off.

10-18-2008, 12:29 PM
It has nothing to do with the days. It's because -- as I indicated -- the next one that gets run seems to be whatever one 'frees' up first. There' s a bug reported against that.

10-18-2008, 12:56 PM
OK. Thanks. All I can do is report the facts. I rely on you for the interpretation. Best regards.