I won't give an answer to the original question here, but if you're trying to schedule tasks for Mac OS 10.9+ with cron
, you're doing it wrong: crontab
is deprecated. You should use launchctl
with launchd
(man page here) instead.
launchd
/launchctl
works with .plist
files that describe each task, similar to the way you'd use systemd
/systemctl
with .service
files.
It may be unsettling at first, but it's actually easy to use, although it's less convenient than using cron
with a single crontab -e
.
Fortunately, there's a lot of GUI softwares available to manage launchd
tasks easily. My personal favorite is Launch Control by soma-zone. It's 10$ but you can download and use their software without limitation.
Anyway, in your case, here's what your ~/Library/LaunchAgents/HelpfulFunctionsJob.plist
file should look like:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>HelpfulFunctions.job</string>
<key>Program</key>
<string>/Users/bclayman/Desktop/SquashScraper/helpfulFunctions.py</string>
<key>RunAtLoad</key>
<true/>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>23</integer>
<key>Minute</key>
<integer>0</integer>
<key>Weekday</key>
<integer>7</integer>
</dict>
</dict>
</plist>
Just make sure to change <string>/Users/bclayman/Desktop/SquashScraper/helpfulFunctions.py</string>
to your actual path, and then, to load the job:
launchctl load -w ~/Library/LaunchAgents/HelpfulFunctionsJob.plist