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;









1

















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?










share|improve this question




























  • 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/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











  • @PerlDuck, Which method will be better to use cron or systemd timer ?

    – mcv
    May 6 at 11:07

















1

















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?










share|improve this question




























  • 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/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











  • @PerlDuck, Which method will be better to use cron or systemd timer ?

    – mcv
    May 6 at 11:07













1












1








1








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?










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question



share|improve this question








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/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











  • @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











  • 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











  • 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
















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










2 Answers
2






active

oldest

votes


















4


















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





share|improve this answer

































    1


















    Use the following:



    @reboot root /usr/bin/python /home/pi/do.py>>/home/pi/output





    share|improve this answer




























    • It will not run at every 30 minutes after reboot.

      – mcv
      May 6 at 10:48












    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
    );



    );














    draft saved

    draft discarded
















    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









    4


















    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





    share|improve this answer






























      4


















      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





      share|improve this answer




























        4














        4










        4









        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





        share|improve this answer














        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






        share|improve this answer













        share|improve this answer




        share|improve this answer



        share|improve this answer










        answered May 6 at 11:11









        dessertdessert

        29.3k7 gold badges88 silver badges121 bronze badges




        29.3k7 gold badges88 silver badges121 bronze badges


























            1


















            Use the following:



            @reboot root /usr/bin/python /home/pi/do.py>>/home/pi/output





            share|improve this answer




























            • It will not run at every 30 minutes after reboot.

              – mcv
              May 6 at 10:48















            1


















            Use the following:



            @reboot root /usr/bin/python /home/pi/do.py>>/home/pi/output





            share|improve this answer




























            • It will not run at every 30 minutes after reboot.

              – mcv
              May 6 at 10:48













            1














            1










            1









            Use the following:



            @reboot root /usr/bin/python /home/pi/do.py>>/home/pi/output





            share|improve this answer
















            Use the following:



            @reboot root /usr/bin/python /home/pi/do.py>>/home/pi/output






            share|improve this answer















            share|improve this answer




            share|improve this answer



            share|improve this answer








            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

















            • 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


















            draft saved

            draft discarded















































            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.




            draft saved


            draft discarded














            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





















































            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









            Popular posts from this blog

            Distance measures on a map of a game The 2019 Stack Overflow Developer Survey Results Are Inmin distance in a graphShortest distance path on contour plotHow to plot a tilted map?Finding points outside of a diskDelaunay link distanceAnnulus from GeoDisks: drawing a ring on a mapNegative Correlation DistanceFind distance along a path (GPS coordinates)Finding position at given distance in a GeoPathMathematics behind distance estimation using camera

            How to get a smooth, uniform ParametricPlot of a 2D Region?How to plot a complicated Region?How to exclude a region from ParametricPlotHow discretize a region placing vertices on a specific non-uniform gridHow to transform a Plot or a ParametricPlot into a RegionHow can I get a smooth plot of a bounded region?Smooth ParametricPlot3D with RegionFunction?Smooth border of a region ParametricPlotSmooth region boundarySmooth region plot from list of pointsGet minimum y of a certain x in a region

            Genealogie vun de Merowenger Vum Merowech bis zum Chilperich I. | Navigatiounsmenü