Amazon EC2 上的 Cronjob 已删除?
我设置了一个 cronjob 来每天运行一个 php 脚本,大约一个月运行顺利。今天,我意识到它没有运行脚本,所以我打开了 crontab。 crontab 完全是空的——发生了什么?
我对 cronjobs 不太了解,但据我了解,如果服务器重置,它们不会删除自己。如何确保 cronjobs 始终运行并且不会被删除?
I had a cronjob set up to run a php script daily, which went well for about a month. Today, I realized it didn't run the script so I opened up the crontab. The crontab is completely empty - what happened?
I don't know too much about cronjobs, but as far as I understand, they do not delete themselves if the server is reset. How can I make sure cronjobs are always running and that it doesnt get deleted?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它可能在不同的用户下。检查根用户
sudo crontab -e
。每个用户都有自己的 crontab,并且有一个适用于整个系统的 crontab。注意:通过 crontab 配置,您可以禁用每用户 crontab。It is probably under a different user. Check root user
sudo crontab -e
. Each user has it's own crontab and there's one for the whole system. Note: Through the crontab configuration you can disable per-user crontabs.