atrun precision

Discussion in 'Mac Programming' started by elchemor, Jan 2, 2013.

  1. macrumors member

    Joined:
    May 10, 2011
    Location:
    Abu Dhabi - UAE
    #1
    Hey everyone,

    before i start, i know many will jump saying get an RTOS, but am not able to find any that works on Mac (parallels, or native)

    what am trying to do, is run some at jobs to schedule scripts to run, i need seconds precision to run them to avoid them running simultaneously, aka : 22:10:02 - 22:10:25 - 22:10:42

    with the command at -t CCYYmmddhhmm.SS the .SS (second) is always ignored by OS X (mountain lion here) no matter what i provide, it always launch at the .00 mark or simultaneous for that matter, sometimes it delays like 20 seconds to send.

    now, i can do a shell script with a sleep in between the commands i wish to launch, but not being able to know how long exactly each one would take *it could vary in few seconds), i may end up with the command number 400 being several minutes after desired time. (last time i tried i was 20 minutes late)

    is there any known way, for making the ATRUN seconds aware (real-time) ? or that's a dead case ??
     
  2. ytk
    macrumors regular

    Joined:
    Jul 8, 2010
    #2
    I don't understand why the shell script option won't work for you. Just set it up to fire off the commands in the background (add an & to the end of each line), then sleep for the required time between commands. That way you can know exactly when each command in the sequence starts. You just won't know when each command ends, so some commands might end up running concurrently, but it sounds like that's the intended behavior in this case.
     
  3. thread starter macrumors member

    Joined:
    May 10, 2011
    Location:
    Abu Dhabi - UAE
    #3
    yeah, that's something that didnt cross my mind, having them run in the background (and sleep the time from start to start) instead from finish to start.

    will see how will that go.
     

Share This Page