科技密码
记录网络点滴生活

alpine使用crontab定时任务不执行

alpine版本:3.20.2
使用apk add cronie安装crontab后,一开始定时任务能运行,系统重启后却不能运行。网上搜的方法试了很多都不管用。无奈重新安装一下crontab试试。

apk del cronie
apk add cronie

安装后发现有个提示:

* you have installed the cronie openrc service,
* but the "crond" service is detected as running/enabled.
* if you wish to use cronie, ensure that you remove the "crond"
* service:
*  rc-update del crond
* and enable the "cronie" service:
*  rc-update add cronie
* keeping cronie installed while using the "crond" service

按照提示执行:

rc-update del crond
rc-update add cronie

重启系统后定时任务恢复正常。(但重启系统这步未测试是否是必须)

赞(0) 打赏
猛牛哥原创:科技密码 » alpine使用crontab定时任务不执行

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏