我正在尝试从 crontab 的 python 代码执行 PyInstaller 创建的二进制文件。我尝试使用“crontab -e”插入多行,但未执行二进制文件。
我尝试过的 crontab 命令示例:
* */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
Run Code Online (Sandbox Code Playgroud)
你知道如何执行这个二进制文件吗?我正在尝试在 Ubuntu 16.04 VPS 服务器上执行这些命令。
预先感谢您的帮助,并为我的英语感到抱歉。
vid*_*rlo 16
使用绝对路径:
* */12 * * * /Path/dist/BinaryFile > LogFile.txt
Run Code Online (Sandbox Code Playgroud)
此外,该文件必须是可执行的。这可以通过chmod +x /Path/dist/BinaryFile.
请注意,时间可能不是您想要的,但它会运行得很好。
| 归档时间: |
|
| 查看次数: |
3201 次 |
| 最近记录: |