docker 中在容器中安装crontab
- 安装
apt-get install cronapt-get update - 启动
service cron status service cron start - crontab -e
如果出现下面的报错:no crontab for root - using an empty one/usr/bin/sensible-editor: 25: /usr/bin/sensible-editor: editor: not found/usr/bin/sensible-editor: 28: /usr/bin/sensible-editor: nano: not found/usr/bin/sensible-editor: 31: /usr/bin/sensible-editor: nano-tiny: not found/usr/bin/sensible-editor: 34: /usr/bin/sensible-editor: vi: not foundCouldn't find an editor!Set the $EDITOR environment variable to your desired editor.crontab: "/usr/bin/sensible-editor" exited with status 1
则先安装vim
apt-get install vim -y
本文来自博客园,作者:Carvers,转载请注明原文链接:https://www.cnblogs.com/carver/articles/17563860.html

浙公网安备 33010602011771号