Does `at` run a command later if the computer is off at the specified time?
Clash Royale CLAN TAG#URR8PPP
up vote
17
down vote
favorite
I want to schedule jobs with at
, but I'm not sure what happens if the computer is suspended at the specified time: Will the command be executed as soon as the computer wakes up again (like with anacron
) or will it not be executed at all (like with cron
)?
If you specify a job to absolutely run at a specific time and date in
the past, the job will run as soon as possible.
That's what the manpage says about that, however it doesn't quite match my case: I don't want to specify a job to run in the past, I want to run it in the future and ask how at
will treat it if the computer is sleeping then.
This is not a duplicate of Run at command when computer is sleeping because this question asks whether at
will wake up the computer to execute the command, neither is it a duplicate of How to prevent atd from running past jobs? because this is about how to prevent at
from executing those âÂÂoldâ jobs (with a very good answer though!).
scheduling at
add a comment |Â
up vote
17
down vote
favorite
I want to schedule jobs with at
, but I'm not sure what happens if the computer is suspended at the specified time: Will the command be executed as soon as the computer wakes up again (like with anacron
) or will it not be executed at all (like with cron
)?
If you specify a job to absolutely run at a specific time and date in
the past, the job will run as soon as possible.
That's what the manpage says about that, however it doesn't quite match my case: I don't want to specify a job to run in the past, I want to run it in the future and ask how at
will treat it if the computer is sleeping then.
This is not a duplicate of Run at command when computer is sleeping because this question asks whether at
will wake up the computer to execute the command, neither is it a duplicate of How to prevent atd from running past jobs? because this is about how to prevent at
from executing those âÂÂoldâ jobs (with a very good answer though!).
scheduling at
add a comment |Â
up vote
17
down vote
favorite
up vote
17
down vote
favorite
I want to schedule jobs with at
, but I'm not sure what happens if the computer is suspended at the specified time: Will the command be executed as soon as the computer wakes up again (like with anacron
) or will it not be executed at all (like with cron
)?
If you specify a job to absolutely run at a specific time and date in
the past, the job will run as soon as possible.
That's what the manpage says about that, however it doesn't quite match my case: I don't want to specify a job to run in the past, I want to run it in the future and ask how at
will treat it if the computer is sleeping then.
This is not a duplicate of Run at command when computer is sleeping because this question asks whether at
will wake up the computer to execute the command, neither is it a duplicate of How to prevent atd from running past jobs? because this is about how to prevent at
from executing those âÂÂoldâ jobs (with a very good answer though!).
scheduling at
I want to schedule jobs with at
, but I'm not sure what happens if the computer is suspended at the specified time: Will the command be executed as soon as the computer wakes up again (like with anacron
) or will it not be executed at all (like with cron
)?
If you specify a job to absolutely run at a specific time and date in
the past, the job will run as soon as possible.
That's what the manpage says about that, however it doesn't quite match my case: I don't want to specify a job to run in the past, I want to run it in the future and ask how at
will treat it if the computer is sleeping then.
This is not a duplicate of Run at command when computer is sleeping because this question asks whether at
will wake up the computer to execute the command, neither is it a duplicate of How to prevent atd from running past jobs? because this is about how to prevent at
from executing those âÂÂoldâ jobs (with a very good answer though!).
scheduling at
edited Dec 15 '17 at 13:05
asked Dec 15 '17 at 11:00
dessert
1,013321
1,013321
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
19
down vote
at
executes any command that should have been executed before when you wake up the computer, but may take a few minutes to do that. It doesn't even matter whether you gave it a specific date, as you can test easily:
$ sudo date -s "2017-12-15 23:57:00"
$ at 23:59 17-12-15 <<<'echo executed >at_test'
job 1 at Fri Dec 15 23:59:00 2017
# suspend, wake after four minutes
$ date
Sat Dec 16 00:01:17 CET 2017
$ cat <at_test || atq
bash: /home/dessert/at_test: No such file or directory
1 Fri Dec 15 23:59:00 2017 a dessert
# wait a few minutes
$ cat <at_test || atq
executed
So a job you add using at 20:00 today
can very well be executed suddenly three days later when you power on your computer again. If you want to prevent this you can check for the time in the job itself like proposed here: How to prevent atd from running past jobs?
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
19
down vote
at
executes any command that should have been executed before when you wake up the computer, but may take a few minutes to do that. It doesn't even matter whether you gave it a specific date, as you can test easily:
$ sudo date -s "2017-12-15 23:57:00"
$ at 23:59 17-12-15 <<<'echo executed >at_test'
job 1 at Fri Dec 15 23:59:00 2017
# suspend, wake after four minutes
$ date
Sat Dec 16 00:01:17 CET 2017
$ cat <at_test || atq
bash: /home/dessert/at_test: No such file or directory
1 Fri Dec 15 23:59:00 2017 a dessert
# wait a few minutes
$ cat <at_test || atq
executed
So a job you add using at 20:00 today
can very well be executed suddenly three days later when you power on your computer again. If you want to prevent this you can check for the time in the job itself like proposed here: How to prevent atd from running past jobs?
add a comment |Â
up vote
19
down vote
at
executes any command that should have been executed before when you wake up the computer, but may take a few minutes to do that. It doesn't even matter whether you gave it a specific date, as you can test easily:
$ sudo date -s "2017-12-15 23:57:00"
$ at 23:59 17-12-15 <<<'echo executed >at_test'
job 1 at Fri Dec 15 23:59:00 2017
# suspend, wake after four minutes
$ date
Sat Dec 16 00:01:17 CET 2017
$ cat <at_test || atq
bash: /home/dessert/at_test: No such file or directory
1 Fri Dec 15 23:59:00 2017 a dessert
# wait a few minutes
$ cat <at_test || atq
executed
So a job you add using at 20:00 today
can very well be executed suddenly three days later when you power on your computer again. If you want to prevent this you can check for the time in the job itself like proposed here: How to prevent atd from running past jobs?
add a comment |Â
up vote
19
down vote
up vote
19
down vote
at
executes any command that should have been executed before when you wake up the computer, but may take a few minutes to do that. It doesn't even matter whether you gave it a specific date, as you can test easily:
$ sudo date -s "2017-12-15 23:57:00"
$ at 23:59 17-12-15 <<<'echo executed >at_test'
job 1 at Fri Dec 15 23:59:00 2017
# suspend, wake after four minutes
$ date
Sat Dec 16 00:01:17 CET 2017
$ cat <at_test || atq
bash: /home/dessert/at_test: No such file or directory
1 Fri Dec 15 23:59:00 2017 a dessert
# wait a few minutes
$ cat <at_test || atq
executed
So a job you add using at 20:00 today
can very well be executed suddenly three days later when you power on your computer again. If you want to prevent this you can check for the time in the job itself like proposed here: How to prevent atd from running past jobs?
at
executes any command that should have been executed before when you wake up the computer, but may take a few minutes to do that. It doesn't even matter whether you gave it a specific date, as you can test easily:
$ sudo date -s "2017-12-15 23:57:00"
$ at 23:59 17-12-15 <<<'echo executed >at_test'
job 1 at Fri Dec 15 23:59:00 2017
# suspend, wake after four minutes
$ date
Sat Dec 16 00:01:17 CET 2017
$ cat <at_test || atq
bash: /home/dessert/at_test: No such file or directory
1 Fri Dec 15 23:59:00 2017 a dessert
# wait a few minutes
$ cat <at_test || atq
executed
So a job you add using at 20:00 today
can very well be executed suddenly three days later when you power on your computer again. If you want to prevent this you can check for the time in the job itself like proposed here: How to prevent atd from running past jobs?
edited Dec 15 '17 at 13:04
answered Dec 15 '17 at 11:00
dessert
1,013321
1,013321
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%2f411022%2fdoes-at-run-a-command-later-if-the-computer-is-off-at-the-specified-time%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