0

I have a simple Python script and I want it to be runned in every minute periodically with crontab. When I run the script from command line like;

python3 /path/to/file/script.py

it works properly.

I editted the crontab with crontab -e command:

* * * * * python3 /path/to/file/script.py

However it doesn't work and occurs an error on main:

/Library/Developer/CommandLineTools/usr/bin/python3: can't open file '/Users/admin/Desktop/vue-exercises/startupfon-backend/startupfon/backend/scripts/test.py': [Errno 1] Operation not permitted

Additionally I've tried to pass python like /usr/bin/python3 to crontab, the result remains same.

yasinkuyuk
  • 49
  • 3
  • You may be running into the TCC privacy protection system; it considers users' Desktop folders private areas, and doesn't allow software access without special approval. See [this](https://apple.stackexchange.com/questions/431541) and [this](https://apple.stackexchange.com/questions/425519) on Ask Different, and [this](https://stackoverflow.com/questions/54487270) and [this](https://stackoverflow.com/questions/58844669) here on Stackexchange. But rather than granting privacy access, I'd recommend putting the script somewhere *non*private. – Gordon Davisson Jan 18 '22 at 11:00

0 Answers0