Crontab not working on my linux systemWhy doesn't this script output to a text file when run from...

Trouble understanding the speech of overseas colleagues

Large drywall patch supports

How does buying out courses with grant money work?

How can I get through very long and very dry, but also very useful technical documents when learning a new tool?

Go Pregnant or Go Home

How do I rename a Linux host without needing to reboot for the rename to take effect?

Would this custom Sorcerer variant that can only learn any verbal-component-only spell be unbalanced?

How does the UK government determine the size of a mandate?

How to be diplomatic in refusing to write code that breaches the privacy of our users

Was Spock the First Vulcan in Starfleet?

How does it work when somebody invests in my business?

How to Reset Passwords on Multiple Websites Easily?

Why are there no referendums in the US?

Roman Numeral Treatment of Suspensions

Implement the Thanos sorting algorithm

Failed to fetch jessie backports repository

What is the best translation for "slot" in the context of multiplayer video games?

Valid Badminton Score?

A problem in Probability theory

What is paid subscription needed for in Mortal Kombat 11?

How did Doctor Strange see the winning outcome in Avengers: Infinity War?

Short story about space worker geeks who zone out by 'listening' to radiation from stars

Is there a korbon needed for conversion?

How can a function with a hole (removable discontinuity) equal a function with no hole?



Crontab not working on my linux system


Why doesn't this script output to a text file when run from cron?Cronjob Bash not exportingList all non system usersIntermittent crontab problemWhy putting a script in /etc/cron.hourly is not working?Can't run Bash scriptCrontab says command not foundrun crontab as www-data to create a file with www-data as ownercrontab -e does not open the crontab for this userHaving trouble getting .sh working with crontab













0















I am using a simple crontab query which I want to run but seems like its not working. Here it is which I write on sudo user:




0 0 0/12 1/1 * ? * /home/homeassistant/.homeassistant/hassbianrestart.sh >
/dev/null 2>&1




And here in the hassbianrestart.sh script have this line only!



   #!/bin/bash
sudo systemctl restart home-assistant@homeassistant.service


I also changed the file permission to 600. Then also I am not able to see it running anytime!



If I run the file directly ./hassbianrestart.sh it works fine.



any suggestions?









share



























    0















    I am using a simple crontab query which I want to run but seems like its not working. Here it is which I write on sudo user:




    0 0 0/12 1/1 * ? * /home/homeassistant/.homeassistant/hassbianrestart.sh >
    /dev/null 2>&1




    And here in the hassbianrestart.sh script have this line only!



       #!/bin/bash
    sudo systemctl restart home-assistant@homeassistant.service


    I also changed the file permission to 600. Then also I am not able to see it running anytime!



    If I run the file directly ./hassbianrestart.sh it works fine.



    any suggestions?









    share

























      0












      0








      0








      I am using a simple crontab query which I want to run but seems like its not working. Here it is which I write on sudo user:




      0 0 0/12 1/1 * ? * /home/homeassistant/.homeassistant/hassbianrestart.sh >
      /dev/null 2>&1




      And here in the hassbianrestart.sh script have this line only!



         #!/bin/bash
      sudo systemctl restart home-assistant@homeassistant.service


      I also changed the file permission to 600. Then also I am not able to see it running anytime!



      If I run the file directly ./hassbianrestart.sh it works fine.



      any suggestions?









      share














      I am using a simple crontab query which I want to run but seems like its not working. Here it is which I write on sudo user:




      0 0 0/12 1/1 * ? * /home/homeassistant/.homeassistant/hassbianrestart.sh >
      /dev/null 2>&1




      And here in the hassbianrestart.sh script have this line only!



         #!/bin/bash
      sudo systemctl restart home-assistant@homeassistant.service


      I also changed the file permission to 600. Then also I am not able to see it running anytime!



      If I run the file directly ./hassbianrestart.sh it works fine.



      any suggestions?







      command-line bash scripts cron





      share












      share










      share



      share










      asked 3 mins ago









      Nehul AgrawalNehul Agrawal

      11




      11






















          0






          active

          oldest

          votes











          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/3.0/"u003ecc by-sa 3.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%2f1129310%2fcrontab-not-working-on-my-linux-system%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          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%2f1129310%2fcrontab-not-working-on-my-linux-system%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

          Why do type traits not work with types in namespace scope?What are POD types in C++?Why can templates only be...

          Will tsunami waves travel forever if there was no land?Why do tsunami waves begin with the water flowing away...

          Simple Scan not detecting my scanner (Brother DCP-7055W)Brother MFC-L2700DW printer can print, can't...