Trying to run a daemon with crontab





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







1















Im very new to linux/ubuntu, and I learned a few stuff by setting up few nodes for cryptocurrencies like Zcoin. I keep bumping into one issue though!



In nodes, if your server is disconnected/offline/ doesn't run for whatever reason for more than 3h, they you are penalized and you are ending up in the end of the queue. Im hosting with Vultr at the moment(running ubuntu 16.04), and occasionally, they will put some servers into maintenance/reboot for hardware failure/some repairs.
So, ideally , i would love a way to have a cronjob that could bring the daemon(the zcoin daemon in my case) back to life on every reboot !



At the moment, after i login to the server, i type those 2 commands:





  1. cd ~/zcoin-0.13.7/bin and then

  2. ./zcoind -daemon


And that's it!

Can someone please tell me how on earth I need to put the syntax on the crontab -e ?!?










share|improve this question































    1















    Im very new to linux/ubuntu, and I learned a few stuff by setting up few nodes for cryptocurrencies like Zcoin. I keep bumping into one issue though!



    In nodes, if your server is disconnected/offline/ doesn't run for whatever reason for more than 3h, they you are penalized and you are ending up in the end of the queue. Im hosting with Vultr at the moment(running ubuntu 16.04), and occasionally, they will put some servers into maintenance/reboot for hardware failure/some repairs.
    So, ideally , i would love a way to have a cronjob that could bring the daemon(the zcoin daemon in my case) back to life on every reboot !



    At the moment, after i login to the server, i type those 2 commands:





    1. cd ~/zcoin-0.13.7/bin and then

    2. ./zcoind -daemon


    And that's it!

    Can someone please tell me how on earth I need to put the syntax on the crontab -e ?!?










    share|improve this question



























      1












      1








      1








      Im very new to linux/ubuntu, and I learned a few stuff by setting up few nodes for cryptocurrencies like Zcoin. I keep bumping into one issue though!



      In nodes, if your server is disconnected/offline/ doesn't run for whatever reason for more than 3h, they you are penalized and you are ending up in the end of the queue. Im hosting with Vultr at the moment(running ubuntu 16.04), and occasionally, they will put some servers into maintenance/reboot for hardware failure/some repairs.
      So, ideally , i would love a way to have a cronjob that could bring the daemon(the zcoin daemon in my case) back to life on every reboot !



      At the moment, after i login to the server, i type those 2 commands:





      1. cd ~/zcoin-0.13.7/bin and then

      2. ./zcoind -daemon


      And that's it!

      Can someone please tell me how on earth I need to put the syntax on the crontab -e ?!?










      share|improve this question
















      Im very new to linux/ubuntu, and I learned a few stuff by setting up few nodes for cryptocurrencies like Zcoin. I keep bumping into one issue though!



      In nodes, if your server is disconnected/offline/ doesn't run for whatever reason for more than 3h, they you are penalized and you are ending up in the end of the queue. Im hosting with Vultr at the moment(running ubuntu 16.04), and occasionally, they will put some servers into maintenance/reboot for hardware failure/some repairs.
      So, ideally , i would love a way to have a cronjob that could bring the daemon(the zcoin daemon in my case) back to life on every reboot !



      At the moment, after i login to the server, i type those 2 commands:





      1. cd ~/zcoin-0.13.7/bin and then

      2. ./zcoind -daemon


      And that's it!

      Can someone please tell me how on earth I need to put the syntax on the crontab -e ?!?







      server cron






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 7 at 14:57







      Aleksandros F.

















      asked Apr 6 at 23:52









      Aleksandros F.Aleksandros F.

      64




      64






















          2 Answers
          2






          active

          oldest

          votes


















          1














          Please use the official supported method (I copied only the relevant parts regarding Linux and systemd):




          Sample init scripts and service configuration for bitcoind



          Sample scripts and configuration files for systemd, Upstart and OpenRC can be found in the contrib/init folder.




          contrib/init/bitcoind.service:    systemd service unit configuration



          4a) systemd



          Installing this .service file consists of just copying it to /usr/lib/systemd/system directory, followed by the command systemctl daemon-reload in order to update running systemd configuration.



          To test, run systemctl start zcoind and to enable for system startup run systemctl enable zcoind




          The service itself has a Restart=always.






          share|improve this answer































            0














            Finally found it. after crontab -e i put on the last line :



            @reboot ~/zcoin-0.13.7/bin/zcoind -daemon


            I'll leave it here in case someone else finds it useful!






            share|improve this answer


























              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%2f1131764%2ftrying-to-run-a-daemon-with-crontab%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









              1














              Please use the official supported method (I copied only the relevant parts regarding Linux and systemd):




              Sample init scripts and service configuration for bitcoind



              Sample scripts and configuration files for systemd, Upstart and OpenRC can be found in the contrib/init folder.




              contrib/init/bitcoind.service:    systemd service unit configuration



              4a) systemd



              Installing this .service file consists of just copying it to /usr/lib/systemd/system directory, followed by the command systemctl daemon-reload in order to update running systemd configuration.



              To test, run systemctl start zcoind and to enable for system startup run systemctl enable zcoind




              The service itself has a Restart=always.






              share|improve this answer




























                1














                Please use the official supported method (I copied only the relevant parts regarding Linux and systemd):




                Sample init scripts and service configuration for bitcoind



                Sample scripts and configuration files for systemd, Upstart and OpenRC can be found in the contrib/init folder.




                contrib/init/bitcoind.service:    systemd service unit configuration



                4a) systemd



                Installing this .service file consists of just copying it to /usr/lib/systemd/system directory, followed by the command systemctl daemon-reload in order to update running systemd configuration.



                To test, run systemctl start zcoind and to enable for system startup run systemctl enable zcoind




                The service itself has a Restart=always.






                share|improve this answer


























                  1












                  1








                  1







                  Please use the official supported method (I copied only the relevant parts regarding Linux and systemd):




                  Sample init scripts and service configuration for bitcoind



                  Sample scripts and configuration files for systemd, Upstart and OpenRC can be found in the contrib/init folder.




                  contrib/init/bitcoind.service:    systemd service unit configuration



                  4a) systemd



                  Installing this .service file consists of just copying it to /usr/lib/systemd/system directory, followed by the command systemctl daemon-reload in order to update running systemd configuration.



                  To test, run systemctl start zcoind and to enable for system startup run systemctl enable zcoind




                  The service itself has a Restart=always.






                  share|improve this answer













                  Please use the official supported method (I copied only the relevant parts regarding Linux and systemd):




                  Sample init scripts and service configuration for bitcoind



                  Sample scripts and configuration files for systemd, Upstart and OpenRC can be found in the contrib/init folder.




                  contrib/init/bitcoind.service:    systemd service unit configuration



                  4a) systemd



                  Installing this .service file consists of just copying it to /usr/lib/systemd/system directory, followed by the command systemctl daemon-reload in order to update running systemd configuration.



                  To test, run systemctl start zcoind and to enable for system startup run systemctl enable zcoind




                  The service itself has a Restart=always.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Apr 7 at 15:05









                  RinzwindRinzwind

                  211k28406541




                  211k28406541

























                      0














                      Finally found it. after crontab -e i put on the last line :



                      @reboot ~/zcoin-0.13.7/bin/zcoind -daemon


                      I'll leave it here in case someone else finds it useful!






                      share|improve this answer






























                        0














                        Finally found it. after crontab -e i put on the last line :



                        @reboot ~/zcoin-0.13.7/bin/zcoind -daemon


                        I'll leave it here in case someone else finds it useful!






                        share|improve this answer




























                          0












                          0








                          0







                          Finally found it. after crontab -e i put on the last line :



                          @reboot ~/zcoin-0.13.7/bin/zcoind -daemon


                          I'll leave it here in case someone else finds it useful!






                          share|improve this answer















                          Finally found it. after crontab -e i put on the last line :



                          @reboot ~/zcoin-0.13.7/bin/zcoind -daemon


                          I'll leave it here in case someone else finds it useful!







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Apr 7 at 15:06









                          Rinzwind

                          211k28406541




                          211k28406541










                          answered Apr 7 at 15:03









                          Aleksandros F.Aleksandros F.

                          64




                          64






























                              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%2f1131764%2ftrying-to-run-a-daemon-with-crontab%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

                              數位音樂下載

                              When can things happen in Etherscan, such as the picture below?

                              格利澤436b