无法使用/usr/local/bin的Shebang运行Python脚本
我有一个python脚本保存到/usr/local/bin的
#!/usr/bin/python3
顶部,并且在重新启动后30秒内运行它,并且无法正常运行。 When I try to run ./usr/local/bin/check_bios.py I get
bash: ./usr/local/bin/check_bios.py: No such file or directory
When I copy it to my home directory it works fine. When I execute it with
python /usr/bin/local/check_bios.py
it runs fine.我
alias python="python3"
在BashRC文件中有,但我不认为这是导致这种行为的原因。我尝试在我的路径中添加/usr/bin/local添加/bin/local,但是Cron不会尽我所能想到的路径。有人知道为什么Cron作业不会执行并whay。如果有帮助,我在Linux Mint 20.2上。
I have a python script saved to /usr/local/bin with
#!/usr/bin/python3
at the top and a chron job to run it 30 seconds after reboot and it's not working. When I try to run ./usr/local/bin/check_bios.py I get
bash: ./usr/local/bin/check_bios.py: No such file or directory
When I copy it to my home directory it works fine. When I execute it with
python /usr/bin/local/check_bios.py
it runs fine. I have
alias python="python3"
in my bashrc file, but I don't think that is what's causing this behavior. I tried adding /usr/bin/local to my path, but cron wouldn't use the path as far as I can think of. Does anyone know why the cron job won't execute and whay ./usr/bin/local/check_bios.py would throw an error? I'm on Linux Mint 20.2 if that helps at all.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从错误中:
cron作业正在寻找
./ usr/local/bin/bin
路径中的check_bios.py脚本。由此,我猜想克朗的工作是:
在哪里?代表时间值(故意将它们留作?既然它们在帖子中没有提及,也没有与问题有关)。
我相信应该是:
From the error:
the cron job was looking for the check_bios.py script in the
./usr/local/bin
path.From that, I guessed that the cron job was:
where ? represents the time values (deliberately left them as ? since they weren't mentioned in the post, nor are they relevant to the issue).
I believe it should be: