crontab在OSX El Capitan上损坏了吗? [英] is crontab broken on OSX El Capitan?

查看:90
本文介绍了crontab在OSX El Capitan上损坏了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题.应该在OSX El Capitan中使用cron吗?

Question. Is cron supposed to work in OSX El Capitan?

背景.我在OSX上使用crontab已有多年了,但是El Capitan似乎不起作用.我将用户名添加到/usr/lib/cron/cron.allow,甚至重新启动了计算机,但我的cron作业仍然不执行任何操作,也没有向我发送错误消息.手册页建议苹果不希望人们使用cron,但他们并没有说它不起作用(还).

Background. I've used crontab for years on OSX, but with El Capitan it seems not to work. I added my username to /usr/lib/cron/cron.allow and even rebooted the machine, but still my cron jobs don't do anything, nor do they mail me with errors. The manpages suggest Apple doesn't want people using cron, but they don't say it is nonfunctional (yet).

推荐答案

它似乎对我有用,但是我认为您需要指定编辑器:

It seems to work for me, but I think you need to specify the editor:

env EDITOR=nano crontab -e

添加您的分支,然后使用给定的名称和位置保存文件.就我而言,它是/tmp/crontab.xxxx中的文件.

Add your crons, and then save the file with the name and location given. In my case it's a file in /tmp/crontab.xxxx.

然后,如果您执行crontab -l,则应该看到您的老兄.

Then if you do crontab -l you should see your crons.

这篇关于crontab在OSX El Capitan上损坏了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆