cron queueing bash and python scripts I'm currently looking to understand and get comfortable with crontab queues on my macbook pro. I recently solved an issue where my simple bash script would not execute. It turns out I had to move my bash script and its output in the /Users/myusername/ path. Before I had it in the /Users/myusername/Desktop/. This post can be found here - https://stackoverflow.com/questions/64110897/simple-bash-script-doesnt-cron-properly?noredirect=1#comment113370465_64110897
My question: Do all of my bash and python scripts need to be housed in /Users/myusername path always? Is there no workaround?
Question:

My question: Do all of my bash and python scripts need to be housed in /Users/myusername path always? Is there no workaround?

Answer:
No. You can locate your bash and python scripts anywhere you like. However, there are additional requirements:

Your cron jobs run with a different ENVIRONMENT than when you run them; e.g. $PATH. Consequently, you should use a full path specification for specifying your scripts in the crontab; for example use:

* * * * * /opt/local/bin/python3 /some/dir/you/choose/myscript.py


On my Mac (Catalina) I've found it necessary to give &quot;Full Disk Access&quot; privileges to cron. YMMV on a different OS version. Here's how:

System Preferences -&gt; Security &amp; Privacy -&gt; Privacy tab:


At least while debugging your cron job, you should consider redirecting any error messages (stderr) to a file - otherwise they wind up in /dev/null which is not helpful! Continuing with the above example:

* * * * * /opt/local/bin/python3 /some/dir/you/choose/myscript.py &gt;&gt; /Home/&lt;username&gt;/MyCronLog.txt 2&gt;&amp;1