[英]Errno 1: Operation not permitted while running cron job in crontab
I know this is a common error and it's been asked many times here on SO.我知道这是一个常见的错误,在 SO 上已经被问过很多次了。 I've been through all the solutions and none of them are working for me.我已经完成了所有的解决方案,但没有一个对我有用。
I'm using crontab on my iMac (running Catalina) to set up a cron job:我在 iMac(运行 Catalina)上使用 crontab 来设置 cron 作业:
42 11,20 * * * cd path/to/directory && echo <password> | sudo -S /Library/Frameworks/Python.framework/Versions/3.8/bin/python3 filename.py >> log.txt
The full error I'm getting:我得到的完整错误:
Password:/Library/Frameworks/Python.framework/Versions/3.8/bin/python3: can't open file 'filename.py': [Errno 1] Operation not permitted
I've tried:我试过了:
but this error never changes.但这个错误永远不会改变。
Any help gratefully accepted.任何帮助都感激地接受。
I was able to resolve this.我能够解决这个问题。 These are steps you can try to follow:这些是您可以尝试遵循的步骤:
To do this, just find out where in your system Python is located, navigate there by pasting the path into Finder->Go->Go To Folder, finding the exe file, and dragging it into the Full Disk Access section of Privacy.为此,只需找出 Python 在您的系统中的位置,通过将路径粘贴到 Finder->Go->Go To Folder 中,找到 exe 文件,然后将其拖到 Privacy 的 Full Disk Access 部分来导航。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.