Executing python script with cron job from MacOS

Viewed 1679

I am trying to create a very simple Cron job on MacOS to execute a Python script.

My Cron job :

* * * * * usr/bin/python3 /Users/gaetan/Desktop/createfolder.py

When I run the script from the terminal is working fine but from cron is not doing anything.

I don't understand what could be the error, I have given all the rights and double check the path.

2 Answers

You can absolutely use cron on macOS. First step grant the binary permissions over your full disk.

cron on macOS privacy

Second, be sure you check for a full path to everything - your python executable is not correct in the question as it needs to start with /usr/...

Here is an answer on a partner site specific to Apple operating systems with details on debugging and privacy controls if you’d like more help.

Related