Command at /etc/crontab not run at reboot?Cron job to run python script at reboot does not workCronjob, every 20 minutes. Starting direct after rebootDaemon or crontab?Crontab Output problemcrontab command not run@reboot works with command but not script - CronCrontab script not runningWhy is my crontab command not working?How to WGET Cronjob to save a webpage periodicallyCrontab for an rsync backup with ssh connectionCrontab won't run command @reboot
Code Golf Measurer © 2019
Interpret a date from a string of digits
Front hydraulic disk brake is too powerful on MTB — solutions?
Is it possible to have 2 ports open on SSH with 2 different authentication schemes?
How can a "proper" function have a vertical slope?
What is the gold linker?
Wanted references to the Phillip K Dick Total Recall (1990) paradox
First author doesn't want a co-author to read the whole paper
Why do Computer Science degrees contain a high proportion of mathematics?
If we should encrypt the message rather than the method of transfer, why do we care about wifi security? Is this just security theatre?
Not returning after leave
Where does the upgrade to macOS Catalina move root "/" directory files?
What do you call a document which has no content?
how to say 'nerd' or 'geek' in french?
Any way to see "cubic-active" vibrational modes in molecules?
Fermat's polygonal number theorem
How to snip same part of screen as last time?
What is the design rationale for having armor and magic penetration mechanics?
Why do these two ways of understanding constant acceleration give different results?
Would preaching in a church be advantageous for becoming a lecturer?
Can you upgrade armour from breastplate to half plate?
Why does Principal Vagina say, "no relation" after introducing himself?
What are some non-CS concepts that can be defined using BNF notation?
Should I avoid "big words" when writing to a younger audience?
Command at /etc/crontab not run at reboot?
Cron job to run python script at reboot does not workCronjob, every 20 minutes. Starting direct after rebootDaemon or crontab?Crontab Output problemcrontab command not run@reboot works with command but not script - CronCrontab script not runningWhy is my crontab command not working?How to WGET Cronjob to save a webpage periodicallyCrontab for an rsync backup with ssh connectionCrontab won't run command @reboot
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
I have used the crontab to run a command that repeats every 30 minutes. From the tutorials, I written the following command to /etc/crontab
*/30 * * * * root /usr/bin/python /home/pi/do.py>>/home/pi/output
As per the tutorials found on google, it should run for 0,30,60...minutes. But it won't run at reboot. However, it runs for every 30 minutes after reboot.
If I use the command @reboot /usr/bin/python /home/pi/do.py>>/home/pi/output, then it will run at reboot. But actually, I need to run the command at boot and also for every 30 minutes.
How can I configure the same for a run at reboot also?
14.04 command-line cron
|
show 2 more comments
I have used the crontab to run a command that repeats every 30 minutes. From the tutorials, I written the following command to /etc/crontab
*/30 * * * * root /usr/bin/python /home/pi/do.py>>/home/pi/output
As per the tutorials found on google, it should run for 0,30,60...minutes. But it won't run at reboot. However, it runs for every 30 minutes after reboot.
If I use the command @reboot /usr/bin/python /home/pi/do.py>>/home/pi/output, then it will run at reboot. But actually, I need to run the command at boot and also for every 30 minutes.
How can I configure the same for a run at reboot also?
14.04 command-line cron
Use this article to achieve your result: cyberciti.biz/faq/linux-execute-cron-job-after-system-reboot
– Novice
May 6 at 10:32
Possible duplicate of Cron job to run python script at reboot does not work
– Novice
May 6 at 10:34
@Novice, I can run the command@reboot /usr/bin/python /home/pi/do.py>>/home/pi/outputwithout any problem. Don't make it as same question.
– mcv
May 6 at 10:53
Maybe Cronjob, every 20 minutes. Starting direct after reboot is of help. It suggests replacing thecronjobwith asystemd timerthat is able to do both: run at boot time and every N minutes.
– PerlDuck
May 6 at 10:58
@PerlDuck, Which method will be better to use cron or systemd timer ?
– mcv
May 6 at 11:07
|
show 2 more comments
I have used the crontab to run a command that repeats every 30 minutes. From the tutorials, I written the following command to /etc/crontab
*/30 * * * * root /usr/bin/python /home/pi/do.py>>/home/pi/output
As per the tutorials found on google, it should run for 0,30,60...minutes. But it won't run at reboot. However, it runs for every 30 minutes after reboot.
If I use the command @reboot /usr/bin/python /home/pi/do.py>>/home/pi/output, then it will run at reboot. But actually, I need to run the command at boot and also for every 30 minutes.
How can I configure the same for a run at reboot also?
14.04 command-line cron
I have used the crontab to run a command that repeats every 30 minutes. From the tutorials, I written the following command to /etc/crontab
*/30 * * * * root /usr/bin/python /home/pi/do.py>>/home/pi/output
As per the tutorials found on google, it should run for 0,30,60...minutes. But it won't run at reboot. However, it runs for every 30 minutes after reboot.
If I use the command @reboot /usr/bin/python /home/pi/do.py>>/home/pi/output, then it will run at reboot. But actually, I need to run the command at boot and also for every 30 minutes.
How can I configure the same for a run at reboot also?
14.04 command-line cron
14.04 command-line cron
edited May 6 at 10:56
mcv
asked May 6 at 10:23
mcvmcv
185 bronze badges
185 bronze badges
Use this article to achieve your result: cyberciti.biz/faq/linux-execute-cron-job-after-system-reboot
– Novice
May 6 at 10:32
Possible duplicate of Cron job to run python script at reboot does not work
– Novice
May 6 at 10:34
@Novice, I can run the command@reboot /usr/bin/python /home/pi/do.py>>/home/pi/outputwithout any problem. Don't make it as same question.
– mcv
May 6 at 10:53
Maybe Cronjob, every 20 minutes. Starting direct after reboot is of help. It suggests replacing thecronjobwith asystemd timerthat is able to do both: run at boot time and every N minutes.
– PerlDuck
May 6 at 10:58
@PerlDuck, Which method will be better to use cron or systemd timer ?
– mcv
May 6 at 11:07
|
show 2 more comments
Use this article to achieve your result: cyberciti.biz/faq/linux-execute-cron-job-after-system-reboot
– Novice
May 6 at 10:32
Possible duplicate of Cron job to run python script at reboot does not work
– Novice
May 6 at 10:34
@Novice, I can run the command@reboot /usr/bin/python /home/pi/do.py>>/home/pi/outputwithout any problem. Don't make it as same question.
– mcv
May 6 at 10:53
Maybe Cronjob, every 20 minutes. Starting direct after reboot is of help. It suggests replacing thecronjobwith asystemd timerthat is able to do both: run at boot time and every N minutes.
– PerlDuck
May 6 at 10:58
@PerlDuck, Which method will be better to use cron or systemd timer ?
– mcv
May 6 at 11:07
Use this article to achieve your result: cyberciti.biz/faq/linux-execute-cron-job-after-system-reboot
– Novice
May 6 at 10:32
Use this article to achieve your result: cyberciti.biz/faq/linux-execute-cron-job-after-system-reboot
– Novice
May 6 at 10:32
Possible duplicate of Cron job to run python script at reboot does not work
– Novice
May 6 at 10:34
Possible duplicate of Cron job to run python script at reboot does not work
– Novice
May 6 at 10:34
@Novice, I can run the command
@reboot /usr/bin/python /home/pi/do.py>>/home/pi/output without any problem. Don't make it as same question.– mcv
May 6 at 10:53
@Novice, I can run the command
@reboot /usr/bin/python /home/pi/do.py>>/home/pi/output without any problem. Don't make it as same question.– mcv
May 6 at 10:53
Maybe Cronjob, every 20 minutes. Starting direct after reboot is of help. It suggests replacing the
cronjob with a systemd timer that is able to do both: run at boot time and every N minutes.– PerlDuck
May 6 at 10:58
Maybe Cronjob, every 20 minutes. Starting direct after reboot is of help. It suggests replacing the
cronjob with a systemd timer that is able to do both: run at boot time and every N minutes.– PerlDuck
May 6 at 10:58
@PerlDuck, Which method will be better to use cron or systemd timer ?
– mcv
May 6 at 11:07
@PerlDuck, Which method will be better to use cron or systemd timer ?
– mcv
May 6 at 11:07
|
show 2 more comments
2 Answers
2
active
oldest
votes
You can’t combine both in one cron line, but there’s nothing wrong with simply having two lines, one for the start at boot and one for running the command every 30 minutes:
*/30 * * * * root /usr/bin/python /home/pi/do.py>>/home/pi/output
@reboot root /usr/bin/python /home/pi/do.py>>/home/pi/output
add a comment
|
Use the following:
@reboot root /usr/bin/python /home/pi/do.py>>/home/pi/output
It will not run at every 30 minutes after reboot.
– mcv
May 6 at 10:48
add a comment
|
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
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',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1140917%2fcommand-at-etc-crontab-not-run-at-reboot%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can’t combine both in one cron line, but there’s nothing wrong with simply having two lines, one for the start at boot and one for running the command every 30 minutes:
*/30 * * * * root /usr/bin/python /home/pi/do.py>>/home/pi/output
@reboot root /usr/bin/python /home/pi/do.py>>/home/pi/output
add a comment
|
You can’t combine both in one cron line, but there’s nothing wrong with simply having two lines, one for the start at boot and one for running the command every 30 minutes:
*/30 * * * * root /usr/bin/python /home/pi/do.py>>/home/pi/output
@reboot root /usr/bin/python /home/pi/do.py>>/home/pi/output
add a comment
|
You can’t combine both in one cron line, but there’s nothing wrong with simply having two lines, one for the start at boot and one for running the command every 30 minutes:
*/30 * * * * root /usr/bin/python /home/pi/do.py>>/home/pi/output
@reboot root /usr/bin/python /home/pi/do.py>>/home/pi/output
You can’t combine both in one cron line, but there’s nothing wrong with simply having two lines, one for the start at boot and one for running the command every 30 minutes:
*/30 * * * * root /usr/bin/python /home/pi/do.py>>/home/pi/output
@reboot root /usr/bin/python /home/pi/do.py>>/home/pi/output
answered May 6 at 11:11
dessertdessert
29.3k7 gold badges88 silver badges121 bronze badges
29.3k7 gold badges88 silver badges121 bronze badges
add a comment
|
add a comment
|
Use the following:
@reboot root /usr/bin/python /home/pi/do.py>>/home/pi/output
It will not run at every 30 minutes after reboot.
– mcv
May 6 at 10:48
add a comment
|
Use the following:
@reboot root /usr/bin/python /home/pi/do.py>>/home/pi/output
It will not run at every 30 minutes after reboot.
– mcv
May 6 at 10:48
add a comment
|
Use the following:
@reboot root /usr/bin/python /home/pi/do.py>>/home/pi/output
Use the following:
@reboot root /usr/bin/python /home/pi/do.py>>/home/pi/output
edited May 6 at 17:34
double-beep
1751 gold badge2 silver badges10 bronze badges
1751 gold badge2 silver badges10 bronze badges
answered May 6 at 10:30
pubpub
111 bronze badge
111 bronze badge
It will not run at every 30 minutes after reboot.
– mcv
May 6 at 10:48
add a comment
|
It will not run at every 30 minutes after reboot.
– mcv
May 6 at 10:48
It will not run at every 30 minutes after reboot.
– mcv
May 6 at 10:48
It will not run at every 30 minutes after reboot.
– mcv
May 6 at 10:48
add a comment
|
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1140917%2fcommand-at-etc-crontab-not-run-at-reboot%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Use this article to achieve your result: cyberciti.biz/faq/linux-execute-cron-job-after-system-reboot
– Novice
May 6 at 10:32
Possible duplicate of Cron job to run python script at reboot does not work
– Novice
May 6 at 10:34
@Novice, I can run the command
@reboot /usr/bin/python /home/pi/do.py>>/home/pi/outputwithout any problem. Don't make it as same question.– mcv
May 6 at 10:53
Maybe Cronjob, every 20 minutes. Starting direct after reboot is of help. It suggests replacing the
cronjobwith asystemd timerthat is able to do both: run at boot time and every N minutes.– PerlDuck
May 6 at 10:58
@PerlDuck, Which method will be better to use cron or systemd timer ?
– mcv
May 6 at 11:07