How do I use `at` to schedule a script to execute on macOS?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I've written a Python script that I need to execute at a certain time after another script runs. I found the at command, and after a bit of digging, I tried the following (broken into multiple lines for readability):



/private/var/folders/w9/6q0rjl6n4yv859fpxbg4123w0000gn/T/S10/fm-git.py
--filename chiv-lib --repository /Users/chuck/Projects/chivalry/chiv-lib/
--path Chivalry/ --comment "test" | at 2:52pm


This ran the script immediately. So I tried



at 2:53pm
> /private/var/folders/w9/6q0rjl6n4yv859fpxbg4123w0000gn/T/S10/fm-git.py
> --filename chiv-lib --repository /Users/chuck/Projects/chivalry/chiv-lib/
> --path Chivalry/ --comment "test"
> ^D


But the time came and went and the script didn't execute. After the above, at -l outputs the following:



13 Mon Nov 27 02:53:00 2017
12 Mon Nov 27 14:52:00 2017


This is on macOS High Sierra. Is at the right utility for this? If so, how can I get it to do what I want here?










share|improve this question























  • It uses fmsadmin, the administration utility for FileMaker Server, to back up a served file, move it to a particular folder, create an XML report of the changes since the last commit, and commits it to the local repository and pushes the changes to the master. The most obvious indication that it's not working is that the Python calls an AppleScript that uses interface scripting to create the XML report. You can find both the Python and AppleScript scripts at github.com/chivalry/fm-git, but it's definitely not executing in the second case, and doing so immediately in the first.
    – Chuck
    Nov 27 '17 at 0:49










  • Note also … you can do echo /private/…foo | at 2:52pm — the echo is important.
    – BRPocock
    Nov 28 '17 at 5:05














up vote
1
down vote

favorite












I've written a Python script that I need to execute at a certain time after another script runs. I found the at command, and after a bit of digging, I tried the following (broken into multiple lines for readability):



/private/var/folders/w9/6q0rjl6n4yv859fpxbg4123w0000gn/T/S10/fm-git.py
--filename chiv-lib --repository /Users/chuck/Projects/chivalry/chiv-lib/
--path Chivalry/ --comment "test" | at 2:52pm


This ran the script immediately. So I tried



at 2:53pm
> /private/var/folders/w9/6q0rjl6n4yv859fpxbg4123w0000gn/T/S10/fm-git.py
> --filename chiv-lib --repository /Users/chuck/Projects/chivalry/chiv-lib/
> --path Chivalry/ --comment "test"
> ^D


But the time came and went and the script didn't execute. After the above, at -l outputs the following:



13 Mon Nov 27 02:53:00 2017
12 Mon Nov 27 14:52:00 2017


This is on macOS High Sierra. Is at the right utility for this? If so, how can I get it to do what I want here?










share|improve this question























  • It uses fmsadmin, the administration utility for FileMaker Server, to back up a served file, move it to a particular folder, create an XML report of the changes since the last commit, and commits it to the local repository and pushes the changes to the master. The most obvious indication that it's not working is that the Python calls an AppleScript that uses interface scripting to create the XML report. You can find both the Python and AppleScript scripts at github.com/chivalry/fm-git, but it's definitely not executing in the second case, and doing so immediately in the first.
    – Chuck
    Nov 27 '17 at 0:49










  • Note also … you can do echo /private/…foo | at 2:52pm — the echo is important.
    – BRPocock
    Nov 28 '17 at 5:05












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I've written a Python script that I need to execute at a certain time after another script runs. I found the at command, and after a bit of digging, I tried the following (broken into multiple lines for readability):



/private/var/folders/w9/6q0rjl6n4yv859fpxbg4123w0000gn/T/S10/fm-git.py
--filename chiv-lib --repository /Users/chuck/Projects/chivalry/chiv-lib/
--path Chivalry/ --comment "test" | at 2:52pm


This ran the script immediately. So I tried



at 2:53pm
> /private/var/folders/w9/6q0rjl6n4yv859fpxbg4123w0000gn/T/S10/fm-git.py
> --filename chiv-lib --repository /Users/chuck/Projects/chivalry/chiv-lib/
> --path Chivalry/ --comment "test"
> ^D


But the time came and went and the script didn't execute. After the above, at -l outputs the following:



13 Mon Nov 27 02:53:00 2017
12 Mon Nov 27 14:52:00 2017


This is on macOS High Sierra. Is at the right utility for this? If so, how can I get it to do what I want here?










share|improve this question















I've written a Python script that I need to execute at a certain time after another script runs. I found the at command, and after a bit of digging, I tried the following (broken into multiple lines for readability):



/private/var/folders/w9/6q0rjl6n4yv859fpxbg4123w0000gn/T/S10/fm-git.py
--filename chiv-lib --repository /Users/chuck/Projects/chivalry/chiv-lib/
--path Chivalry/ --comment "test" | at 2:52pm


This ran the script immediately. So I tried



at 2:53pm
> /private/var/folders/w9/6q0rjl6n4yv859fpxbg4123w0000gn/T/S10/fm-git.py
> --filename chiv-lib --repository /Users/chuck/Projects/chivalry/chiv-lib/
> --path Chivalry/ --comment "test"
> ^D


But the time came and went and the script didn't execute. After the above, at -l outputs the following:



13 Mon Nov 27 02:53:00 2017
12 Mon Nov 27 14:52:00 2017


This is on macOS High Sierra. Is at the right utility for this? If so, how can I get it to do what I want here?







osx command at






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 mins ago









muru

34.4k579149




34.4k579149










asked Nov 26 '17 at 23:01









Chuck

255111




255111











  • It uses fmsadmin, the administration utility for FileMaker Server, to back up a served file, move it to a particular folder, create an XML report of the changes since the last commit, and commits it to the local repository and pushes the changes to the master. The most obvious indication that it's not working is that the Python calls an AppleScript that uses interface scripting to create the XML report. You can find both the Python and AppleScript scripts at github.com/chivalry/fm-git, but it's definitely not executing in the second case, and doing so immediately in the first.
    – Chuck
    Nov 27 '17 at 0:49










  • Note also … you can do echo /private/…foo | at 2:52pm — the echo is important.
    – BRPocock
    Nov 28 '17 at 5:05
















  • It uses fmsadmin, the administration utility for FileMaker Server, to back up a served file, move it to a particular folder, create an XML report of the changes since the last commit, and commits it to the local repository and pushes the changes to the master. The most obvious indication that it's not working is that the Python calls an AppleScript that uses interface scripting to create the XML report. You can find both the Python and AppleScript scripts at github.com/chivalry/fm-git, but it's definitely not executing in the second case, and doing so immediately in the first.
    – Chuck
    Nov 27 '17 at 0:49










  • Note also … you can do echo /private/…foo | at 2:52pm — the echo is important.
    – BRPocock
    Nov 28 '17 at 5:05















It uses fmsadmin, the administration utility for FileMaker Server, to back up a served file, move it to a particular folder, create an XML report of the changes since the last commit, and commits it to the local repository and pushes the changes to the master. The most obvious indication that it's not working is that the Python calls an AppleScript that uses interface scripting to create the XML report. You can find both the Python and AppleScript scripts at github.com/chivalry/fm-git, but it's definitely not executing in the second case, and doing so immediately in the first.
– Chuck
Nov 27 '17 at 0:49




It uses fmsadmin, the administration utility for FileMaker Server, to back up a served file, move it to a particular folder, create an XML report of the changes since the last commit, and commits it to the local repository and pushes the changes to the master. The most obvious indication that it's not working is that the Python calls an AppleScript that uses interface scripting to create the XML report. You can find both the Python and AppleScript scripts at github.com/chivalry/fm-git, but it's definitely not executing in the second case, and doing so immediately in the first.
– Chuck
Nov 27 '17 at 0:49












Note also … you can do echo /private/…foo | at 2:52pm — the echo is important.
– BRPocock
Nov 28 '17 at 5:05




Note also … you can do echo /private/…foo | at 2:52pm — the echo is important.
– BRPocock
Nov 28 '17 at 5:05










1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










Let's see, on Mac OS X (as this hardware is too old to run macOS) plus with myat because I can never remember the date format at wants...



$ date
domingo, 26 de noviembre de 2017, 16:34:12 PST
$ myat 16:36
touch $HOME/nananananananananananananananana-atran
job 2 at Sun Nov 26 16:36:00 2017
$ atq
1 Wed Mar 9 08:00:00 2016
2 Sun Nov 26 16:36:00 2017
$


... why is there a job from 2016 hanging around??



$ date
domingo, 26 de noviembre de 2017, 16:36:33 PST
$ atq
1 Wed Mar 9 08:00:00 2016
2 Sun Nov 26 16:36:00 2017
$


Uhhhh...maybe the man page for at will help?



IMPLEMENTATION NOTES
Note that at is implemented through the launchd(8) daemon periodically
invoking atrun(8), which is disabled by default. See atrun(8) for infor-
mation about enabling atrun.


Meanwhile over in atrun(8) we find...



 Execute the following command as root to enable atrun:
launchctl load -w
/System/Library/LaunchDaemons/com.apple.atrun.plist


Gosh. Let's try that...



$ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.atrun.plist


And then we wait like a minute or two...



$ atq
$ ls *atran
nananananananananananananananana-atran
$


Looks good once you turn it on (warning may drain battery or precious cpu slices...)






share|improve this answer




















    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "",
    contentPolicyHtml: "",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f407181%2fhow-do-i-use-at-to-schedule-a-script-to-execute-on-macos%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted










    Let's see, on Mac OS X (as this hardware is too old to run macOS) plus with myat because I can never remember the date format at wants...



    $ date
    domingo, 26 de noviembre de 2017, 16:34:12 PST
    $ myat 16:36
    touch $HOME/nananananananananananananananana-atran
    job 2 at Sun Nov 26 16:36:00 2017
    $ atq
    1 Wed Mar 9 08:00:00 2016
    2 Sun Nov 26 16:36:00 2017
    $


    ... why is there a job from 2016 hanging around??



    $ date
    domingo, 26 de noviembre de 2017, 16:36:33 PST
    $ atq
    1 Wed Mar 9 08:00:00 2016
    2 Sun Nov 26 16:36:00 2017
    $


    Uhhhh...maybe the man page for at will help?



    IMPLEMENTATION NOTES
    Note that at is implemented through the launchd(8) daemon periodically
    invoking atrun(8), which is disabled by default. See atrun(8) for infor-
    mation about enabling atrun.


    Meanwhile over in atrun(8) we find...



     Execute the following command as root to enable atrun:
    launchctl load -w
    /System/Library/LaunchDaemons/com.apple.atrun.plist


    Gosh. Let's try that...



    $ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.atrun.plist


    And then we wait like a minute or two...



    $ atq
    $ ls *atran
    nananananananananananananananana-atran
    $


    Looks good once you turn it on (warning may drain battery or precious cpu slices...)






    share|improve this answer
























      up vote
      1
      down vote



      accepted










      Let's see, on Mac OS X (as this hardware is too old to run macOS) plus with myat because I can never remember the date format at wants...



      $ date
      domingo, 26 de noviembre de 2017, 16:34:12 PST
      $ myat 16:36
      touch $HOME/nananananananananananananananana-atran
      job 2 at Sun Nov 26 16:36:00 2017
      $ atq
      1 Wed Mar 9 08:00:00 2016
      2 Sun Nov 26 16:36:00 2017
      $


      ... why is there a job from 2016 hanging around??



      $ date
      domingo, 26 de noviembre de 2017, 16:36:33 PST
      $ atq
      1 Wed Mar 9 08:00:00 2016
      2 Sun Nov 26 16:36:00 2017
      $


      Uhhhh...maybe the man page for at will help?



      IMPLEMENTATION NOTES
      Note that at is implemented through the launchd(8) daemon periodically
      invoking atrun(8), which is disabled by default. See atrun(8) for infor-
      mation about enabling atrun.


      Meanwhile over in atrun(8) we find...



       Execute the following command as root to enable atrun:
      launchctl load -w
      /System/Library/LaunchDaemons/com.apple.atrun.plist


      Gosh. Let's try that...



      $ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.atrun.plist


      And then we wait like a minute or two...



      $ atq
      $ ls *atran
      nananananananananananananananana-atran
      $


      Looks good once you turn it on (warning may drain battery or precious cpu slices...)






      share|improve this answer






















        up vote
        1
        down vote



        accepted







        up vote
        1
        down vote



        accepted






        Let's see, on Mac OS X (as this hardware is too old to run macOS) plus with myat because I can never remember the date format at wants...



        $ date
        domingo, 26 de noviembre de 2017, 16:34:12 PST
        $ myat 16:36
        touch $HOME/nananananananananananananananana-atran
        job 2 at Sun Nov 26 16:36:00 2017
        $ atq
        1 Wed Mar 9 08:00:00 2016
        2 Sun Nov 26 16:36:00 2017
        $


        ... why is there a job from 2016 hanging around??



        $ date
        domingo, 26 de noviembre de 2017, 16:36:33 PST
        $ atq
        1 Wed Mar 9 08:00:00 2016
        2 Sun Nov 26 16:36:00 2017
        $


        Uhhhh...maybe the man page for at will help?



        IMPLEMENTATION NOTES
        Note that at is implemented through the launchd(8) daemon periodically
        invoking atrun(8), which is disabled by default. See atrun(8) for infor-
        mation about enabling atrun.


        Meanwhile over in atrun(8) we find...



         Execute the following command as root to enable atrun:
        launchctl load -w
        /System/Library/LaunchDaemons/com.apple.atrun.plist


        Gosh. Let's try that...



        $ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.atrun.plist


        And then we wait like a minute or two...



        $ atq
        $ ls *atran
        nananananananananananananananana-atran
        $


        Looks good once you turn it on (warning may drain battery or precious cpu slices...)






        share|improve this answer












        Let's see, on Mac OS X (as this hardware is too old to run macOS) plus with myat because I can never remember the date format at wants...



        $ date
        domingo, 26 de noviembre de 2017, 16:34:12 PST
        $ myat 16:36
        touch $HOME/nananananananananananananananana-atran
        job 2 at Sun Nov 26 16:36:00 2017
        $ atq
        1 Wed Mar 9 08:00:00 2016
        2 Sun Nov 26 16:36:00 2017
        $


        ... why is there a job from 2016 hanging around??



        $ date
        domingo, 26 de noviembre de 2017, 16:36:33 PST
        $ atq
        1 Wed Mar 9 08:00:00 2016
        2 Sun Nov 26 16:36:00 2017
        $


        Uhhhh...maybe the man page for at will help?



        IMPLEMENTATION NOTES
        Note that at is implemented through the launchd(8) daemon periodically
        invoking atrun(8), which is disabled by default. See atrun(8) for infor-
        mation about enabling atrun.


        Meanwhile over in atrun(8) we find...



         Execute the following command as root to enable atrun:
        launchctl load -w
        /System/Library/LaunchDaemons/com.apple.atrun.plist


        Gosh. Let's try that...



        $ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.atrun.plist


        And then we wait like a minute or two...



        $ atq
        $ ls *atran
        nananananananananananananananana-atran
        $


        Looks good once you turn it on (warning may drain battery or precious cpu slices...)







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 27 '17 at 0:52









        thrig

        23.2k12854




        23.2k12854



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f407181%2fhow-do-i-use-at-to-schedule-a-script-to-execute-on-macos%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay