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.
* */12 * * * /Path/dist/BinaryFile > LogFile.txt 2>&1
Otherwise, you can fill up mail with errors. – Monty Harder Feb 19 '19 at 18:00/bin/chmod +x /root/program/dist/BinaryFile
doesn't run the file, it changes its permissions. You need to do that once if the file isn't already executable, but the line in your crontab should just include the/root/follow-back/dist/FollowBack > FollowBackLog.txt
part as stated in this answer. Also, you realize that the#
at the beginning of the line you pasted there disables its execution, right? – Kevin Feb 19 '19 at 20:49#
starts a comment, socron
ignores that line. Specifically, "Lines whose first non-space character is a pound-sign (#) are comments, and are ignored." src – Kevin Feb 19 '19 at 20:57