How to run a binary file from crontab? [duplicate]












4
















This question already has an answer here:




  • crontab command not run

    2 answers




I’m trying to execute a binary file created by PyInstaller from a python code from crontab. I have tried to insert many lines by using “crontab -e” but the binary file was not executed.



Example of the crontab commands I have tried:



* */12 * * * Path/dist/BinaryFile > LogFile.txt
* */12 * * * open Path/dist/BinaryFile > LogFile.txt
* */12 * * * root Path/dist/BinaryFile > LogFile.txt
* */12 * * * root open Path/dist/BinaryFile > LogFile.txt


Do you have any idea on how to execute this binary file?
I’m trying to execute those command on Ubuntu 16.04 VPS server.



Thank you in advance for your help and sorry for my English.










share|improve this question









New contributor




ZikoCpp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











marked as duplicate by Robert Riedl, Community 4 hours ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.























    4
















    This question already has an answer here:




    • crontab command not run

      2 answers




    I’m trying to execute a binary file created by PyInstaller from a python code from crontab. I have tried to insert many lines by using “crontab -e” but the binary file was not executed.



    Example of the crontab commands I have tried:



    * */12 * * * Path/dist/BinaryFile > LogFile.txt
    * */12 * * * open Path/dist/BinaryFile > LogFile.txt
    * */12 * * * root Path/dist/BinaryFile > LogFile.txt
    * */12 * * * root open Path/dist/BinaryFile > LogFile.txt


    Do you have any idea on how to execute this binary file?
    I’m trying to execute those command on Ubuntu 16.04 VPS server.



    Thank you in advance for your help and sorry for my English.










    share|improve this question









    New contributor




    ZikoCpp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.











    marked as duplicate by Robert Riedl, Community 4 hours ago


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.





















      4












      4








      4









      This question already has an answer here:




      • crontab command not run

        2 answers




      I’m trying to execute a binary file created by PyInstaller from a python code from crontab. I have tried to insert many lines by using “crontab -e” but the binary file was not executed.



      Example of the crontab commands I have tried:



      * */12 * * * Path/dist/BinaryFile > LogFile.txt
      * */12 * * * open Path/dist/BinaryFile > LogFile.txt
      * */12 * * * root Path/dist/BinaryFile > LogFile.txt
      * */12 * * * root open Path/dist/BinaryFile > LogFile.txt


      Do you have any idea on how to execute this binary file?
      I’m trying to execute those command on Ubuntu 16.04 VPS server.



      Thank you in advance for your help and sorry for my English.










      share|improve this question









      New contributor




      ZikoCpp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.













      This question already has an answer here:




      • crontab command not run

        2 answers




      I’m trying to execute a binary file created by PyInstaller from a python code from crontab. I have tried to insert many lines by using “crontab -e” but the binary file was not executed.



      Example of the crontab commands I have tried:



      * */12 * * * Path/dist/BinaryFile > LogFile.txt
      * */12 * * * open Path/dist/BinaryFile > LogFile.txt
      * */12 * * * root Path/dist/BinaryFile > LogFile.txt
      * */12 * * * root open Path/dist/BinaryFile > LogFile.txt


      Do you have any idea on how to execute this binary file?
      I’m trying to execute those command on Ubuntu 16.04 VPS server.



      Thank you in advance for your help and sorry for my English.





      This question already has an answer here:




      • crontab command not run

        2 answers








      cron






      share|improve this question









      New contributor




      ZikoCpp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      ZikoCpp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 14 hours ago









      terdon

      66.3k12138221




      66.3k12138221






      New contributor




      ZikoCpp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 15 hours ago









      ZikoCppZikoCpp

      242




      242




      New contributor




      ZikoCpp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      ZikoCpp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      ZikoCpp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      marked as duplicate by Robert Riedl, Community 4 hours ago


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









      marked as duplicate by Robert Riedl, Community 4 hours ago


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
























          1 Answer
          1






          active

          oldest

          votes


















          15














          Use an absolute path:



          * */12 * * * /Path/dist/BinaryFile > LogFile.txt


          In addition, the file has to be executable. This can be done with chmod +x /Path/dist/BinaryFile.



          Note that the time is probably not what you want, but it will run just fine.






          share|improve this answer


























          • Don't forget to redirect stderr too: * */12 * * * /Path/dist/BinaryFile > LogFile.txt 2>&1 Otherwise, you can fill up mail with errors.

            – Monty Harder
            7 hours ago











          • Hello, I have tried this and also tried the following command (* */12 * * * root /bin/chmod +x /root/program/dist/BinaryFile > LogFile.txt 2>&1) but the program is still not running. the problem is not in the binary because it's working fine when i click on (i use a gui in my vps). thank you in advance

            – ZikoCpp
            6 hours ago













          • You're aware when it will run?

            – vidarlo
            5 hours ago











          • Yes of course. And for testing the program i'm using a command that must make the program execute every 5 minutes (Ex: # */5 * * * * chmod +x /root/follow-back/dist/FollowBack > FollowBackLog.txt)

            – ZikoCpp
            5 hours ago








          • 1





            @ZikoCpp Yes, # starts a comment, so cron ignores that line. Specifically, "Lines whose first non-space character is a pound-sign (#) are comments, and are ignored." src

            – Kevin
            4 hours ago




















          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          15














          Use an absolute path:



          * */12 * * * /Path/dist/BinaryFile > LogFile.txt


          In addition, the file has to be executable. This can be done with chmod +x /Path/dist/BinaryFile.



          Note that the time is probably not what you want, but it will run just fine.






          share|improve this answer


























          • Don't forget to redirect stderr too: * */12 * * * /Path/dist/BinaryFile > LogFile.txt 2>&1 Otherwise, you can fill up mail with errors.

            – Monty Harder
            7 hours ago











          • Hello, I have tried this and also tried the following command (* */12 * * * root /bin/chmod +x /root/program/dist/BinaryFile > LogFile.txt 2>&1) but the program is still not running. the problem is not in the binary because it's working fine when i click on (i use a gui in my vps). thank you in advance

            – ZikoCpp
            6 hours ago













          • You're aware when it will run?

            – vidarlo
            5 hours ago











          • Yes of course. And for testing the program i'm using a command that must make the program execute every 5 minutes (Ex: # */5 * * * * chmod +x /root/follow-back/dist/FollowBack > FollowBackLog.txt)

            – ZikoCpp
            5 hours ago








          • 1





            @ZikoCpp Yes, # starts a comment, so cron ignores that line. Specifically, "Lines whose first non-space character is a pound-sign (#) are comments, and are ignored." src

            – Kevin
            4 hours ago


















          15














          Use an absolute path:



          * */12 * * * /Path/dist/BinaryFile > LogFile.txt


          In addition, the file has to be executable. This can be done with chmod +x /Path/dist/BinaryFile.



          Note that the time is probably not what you want, but it will run just fine.






          share|improve this answer


























          • Don't forget to redirect stderr too: * */12 * * * /Path/dist/BinaryFile > LogFile.txt 2>&1 Otherwise, you can fill up mail with errors.

            – Monty Harder
            7 hours ago











          • Hello, I have tried this and also tried the following command (* */12 * * * root /bin/chmod +x /root/program/dist/BinaryFile > LogFile.txt 2>&1) but the program is still not running. the problem is not in the binary because it's working fine when i click on (i use a gui in my vps). thank you in advance

            – ZikoCpp
            6 hours ago













          • You're aware when it will run?

            – vidarlo
            5 hours ago











          • Yes of course. And for testing the program i'm using a command that must make the program execute every 5 minutes (Ex: # */5 * * * * chmod +x /root/follow-back/dist/FollowBack > FollowBackLog.txt)

            – ZikoCpp
            5 hours ago








          • 1





            @ZikoCpp Yes, # starts a comment, so cron ignores that line. Specifically, "Lines whose first non-space character is a pound-sign (#) are comments, and are ignored." src

            – Kevin
            4 hours ago
















          15












          15








          15







          Use an absolute path:



          * */12 * * * /Path/dist/BinaryFile > LogFile.txt


          In addition, the file has to be executable. This can be done with chmod +x /Path/dist/BinaryFile.



          Note that the time is probably not what you want, but it will run just fine.






          share|improve this answer















          Use an absolute path:



          * */12 * * * /Path/dist/BinaryFile > LogFile.txt


          In addition, the file has to be executable. This can be done with chmod +x /Path/dist/BinaryFile.



          Note that the time is probably not what you want, but it will run just fine.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 14 hours ago









          terdon

          66.3k12138221




          66.3k12138221










          answered 15 hours ago









          vidarlovidarlo

          10.6k52648




          10.6k52648













          • Don't forget to redirect stderr too: * */12 * * * /Path/dist/BinaryFile > LogFile.txt 2>&1 Otherwise, you can fill up mail with errors.

            – Monty Harder
            7 hours ago











          • Hello, I have tried this and also tried the following command (* */12 * * * root /bin/chmod +x /root/program/dist/BinaryFile > LogFile.txt 2>&1) but the program is still not running. the problem is not in the binary because it's working fine when i click on (i use a gui in my vps). thank you in advance

            – ZikoCpp
            6 hours ago













          • You're aware when it will run?

            – vidarlo
            5 hours ago











          • Yes of course. And for testing the program i'm using a command that must make the program execute every 5 minutes (Ex: # */5 * * * * chmod +x /root/follow-back/dist/FollowBack > FollowBackLog.txt)

            – ZikoCpp
            5 hours ago








          • 1





            @ZikoCpp Yes, # starts a comment, so cron ignores that line. Specifically, "Lines whose first non-space character is a pound-sign (#) are comments, and are ignored." src

            – Kevin
            4 hours ago





















          • Don't forget to redirect stderr too: * */12 * * * /Path/dist/BinaryFile > LogFile.txt 2>&1 Otherwise, you can fill up mail with errors.

            – Monty Harder
            7 hours ago











          • Hello, I have tried this and also tried the following command (* */12 * * * root /bin/chmod +x /root/program/dist/BinaryFile > LogFile.txt 2>&1) but the program is still not running. the problem is not in the binary because it's working fine when i click on (i use a gui in my vps). thank you in advance

            – ZikoCpp
            6 hours ago













          • You're aware when it will run?

            – vidarlo
            5 hours ago











          • Yes of course. And for testing the program i'm using a command that must make the program execute every 5 minutes (Ex: # */5 * * * * chmod +x /root/follow-back/dist/FollowBack > FollowBackLog.txt)

            – ZikoCpp
            5 hours ago








          • 1





            @ZikoCpp Yes, # starts a comment, so cron ignores that line. Specifically, "Lines whose first non-space character is a pound-sign (#) are comments, and are ignored." src

            – Kevin
            4 hours ago



















          Don't forget to redirect stderr too: * */12 * * * /Path/dist/BinaryFile > LogFile.txt 2>&1 Otherwise, you can fill up mail with errors.

          – Monty Harder
          7 hours ago





          Don't forget to redirect stderr too: * */12 * * * /Path/dist/BinaryFile > LogFile.txt 2>&1 Otherwise, you can fill up mail with errors.

          – Monty Harder
          7 hours ago













          Hello, I have tried this and also tried the following command (* */12 * * * root /bin/chmod +x /root/program/dist/BinaryFile > LogFile.txt 2>&1) but the program is still not running. the problem is not in the binary because it's working fine when i click on (i use a gui in my vps). thank you in advance

          – ZikoCpp
          6 hours ago







          Hello, I have tried this and also tried the following command (* */12 * * * root /bin/chmod +x /root/program/dist/BinaryFile > LogFile.txt 2>&1) but the program is still not running. the problem is not in the binary because it's working fine when i click on (i use a gui in my vps). thank you in advance

          – ZikoCpp
          6 hours ago















          You're aware when it will run?

          – vidarlo
          5 hours ago





          You're aware when it will run?

          – vidarlo
          5 hours ago













          Yes of course. And for testing the program i'm using a command that must make the program execute every 5 minutes (Ex: # */5 * * * * chmod +x /root/follow-back/dist/FollowBack > FollowBackLog.txt)

          – ZikoCpp
          5 hours ago







          Yes of course. And for testing the program i'm using a command that must make the program execute every 5 minutes (Ex: # */5 * * * * chmod +x /root/follow-back/dist/FollowBack > FollowBackLog.txt)

          – ZikoCpp
          5 hours ago






          1




          1





          @ZikoCpp Yes, # starts a comment, so cron ignores that line. Specifically, "Lines whose first non-space character is a pound-sign (#) are comments, and are ignored." src

          – Kevin
          4 hours ago







          @ZikoCpp Yes, # starts a comment, so cron ignores that line. Specifically, "Lines whose first non-space character is a pound-sign (#) are comments, and are ignored." src

          – Kevin
          4 hours ago





          Popular posts from this blog

          How to label and detect the document text images

          Tabula Rosettana

          Aureus (color)