I am trying to set up a cronjob to run every minute with the following command:
crontab * * * * * sh /Users/username/Downloads/reddit-notifications-master/notifyer.sh
notifyer.sh has the following contents:
#!/bin/zsh
python3 /Users/yogesh/Downloads/reddit-notifications-master/reddit_notifications.py
When I run the command it says:
"LICENSE":0: bad minute
crontab: errors in crontab file, can't install
Has anyone seen this before? Tried googling but can't find anything on the LICENSE: 0 error.
crontabtakes a filename (to read crontab entries from) as an argument, not a raw crontab entry. It also replaces the current crontab (deleting any current entries), rather than just adding new entries to it. I'd recommend usingcrontab -lto see the current contents; and then possiblycrontab -eto edit the current crontab, although the default editor isviand if you're not familiar with it, it's going to be really hard to use. – Gordon Davisson May 13 '20 at 01:27crontab -loutputs nothing. The crontab contents are currently empty. – orange May 13 '20 at 01:28contab -(note the space and single dash) by itself, then* * * * * sh /Users/username/Downloads/reddit-notifications-master/notifyer.shon the next line (as input to thecrontabprogram), then Control-D on the next line after that to indicate end-of-input. – Gordon Davisson May 13 '20 at 01:30crontabwon’t generate a “license error,” that’s got to be coming from your command. What happens if you run the command manually. Second, you’re starting anshshell to then create a ZSH shell with the shebang in your script. Why not just call the script and let the shebang (#!/bin/zsh) handle the shell? – Allan May 13 '20 at 01:50cronhas been deprecated in favor oflaunchd. You might want to start migrating to that. See: https://apple.stackexchange.com/a/249452/119271 – Allan May 13 '20 at 01:53