37
8
Until now, I have never attempted adding a crontask on my Mac. To my surprise, it threw an error..
[hayek@mac:/www/] 02:33:22 PM: crontab -e 1 .
crontab: no crontab for hayek - using an empty one
crontab: "/usr/bin/vi" exited with status 1
How can I figure out why it's throwing that error?
I'm running Mac OS X Lion 10.7.2
Related: How do I edit crontab files with Vim when I get the error: 'temp file must be edited in place'?
– kenorb – 2015-03-26T00:40:40.650Getting this on OS X 10.11 - found this answer below worked best.
– RichVel – 2017-07-24T06:42:11.4332Are you using cron for a specific reason? On OS x it's largely been superseded by launchd – Daniel Beck – 2011-11-20T22:48:41.617
I wanted to use vnstat to track bandwidth usage, which requires a cronjob. I know I could use an alternative app, but it would still be useful to know how to make cron work on Mac, if at all possible. – Hayek – 2011-11-20T23:10:40.327
1Have you tried
crontab file
to install the table from an external file? Or using a different editor likeEDITOR=NANO crontab -e
? – Lri – 2011-11-21T06:22:28.527@DanielBeck I use cron because it's much quicker to set up a new entry than launchd. – Doug Harris – 2011-11-21T18:32:57.250
What does
crontab -l
show? Are there any other messages in/var/log/cron.log
or/var/log/system.log
? – Doug Harris – 2011-11-21T18:38:24.820@Lri good call! the editor was the issue. It looks like
vi
is the culprit, changing the editor to NANO or evenvim
got cron to work. – Hayek – 2011-11-23T23:07:59.360