How do I use `at` to schedule a script to execute on macOS?
Clash 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?
osx command at
add a comment |Â
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?
osx command at
It usesfmsadmin
, 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 doecho /private/â¦foo | at 2:52pm
â theecho
is important.
â BRPocock
Nov 28 '17 at 5:05
add a comment |Â
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?
osx command at
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
osx command at
edited 2 mins ago
muru
34.4k579149
34.4k579149
asked Nov 26 '17 at 23:01
Chuck
255111
255111
It usesfmsadmin
, 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 doecho /private/â¦foo | at 2:52pm
â theecho
is important.
â BRPocock
Nov 28 '17 at 5:05
add a comment |Â
It usesfmsadmin
, 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 doecho /private/â¦foo | at 2:52pm
â theecho
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
add a comment |Â
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...)
add a comment |Â
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...)
add a comment |Â
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...)
add a comment |Â
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...)
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...)
answered Nov 27 '17 at 0:52
thrig
23.2k12854
23.2k12854
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
â theecho
is important.â BRPocock
Nov 28 '17 at 5:05