问题描述
我试图用crontab -e创建一个crontab,但它会保存在 tmp / crontab.FTt6nI / crontab
I'm trying to make a crontab with crontab -e, but it saves it in tmp/crontab.FTt6nI/crontab
crons不工作,所以我猜这就是问题。但我不明白为什么。
the crons don't work so I guess that's the problem. But I don't understand why.
推荐答案
type:
crontab -l
显示crontab的列表, crontab应该在列表中。您可以设置crontab以通过> [email protected]将输出通过电子邮件发送给您,以这种方式您可以确保cronjob已经运行。
to show list of crontab, your newly added crontab should be on the list. you could set the crontab to email the output to you by > [email protected], in this way you can assure the cronjob is already run.
示例:
* * * * * /usr/bin/php /home/username/public_html/cron.php > [email protected]
确保 crond正在运行:
make sure the crond is running:
/etc/init.d/crond status
如果它下来,启动它(centos / rhel):
if it down, start it (centos/rhel):
/etc/init.d/crond start
debian / ubuntu:
debian/ubuntu:
/etc/init.d/cron start
希望有帮助。
这篇关于crontab被保存在tmp / in debian的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!