I am using OS X 10.11.5, I have a crontab file under '/tmp/crontab', in which it contains:
01 10 * * * /Users/Jhon/Desktop/somescript.scpt
When I run crontab -l
I get output as no crontab for Jhon
Any suggestion what I am doing wrong here?
I am using OS X 10.11.5, I have a crontab file under '/tmp/crontab', in which it contains:
01 10 * * * /Users/Jhon/Desktop/somescript.scpt
When I run crontab -l
I get output as no crontab for Jhon
Any suggestion what I am doing wrong here?
Apple recommends using launchd
which actually runs cron tasks for MacOS. You can still use crontab -e
to edit your crontab, but if you want a one-liner:
(crontab -l 2>/dev/null; echo "01 10 * * * osascript /Users/Jhon/Desktop/somescript.scpt") | crontab - ; crontab -l
See this answer for much more useful details:
How can I configure my computer to run an AppleScript at a specific time? Caveat: without using iCal
cron
has been deprecated in favor of launchd
. It's a good idea to start migrating to the new framework.
– Allan
Apr 17 '18 at 14:50