Loading

docker 中在容器中安装crontab

  1. 安装
    apt-get install cron
    apt-get update
  2.  启动
    service cron status
    service cron start 
  3. 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 found
    Couldn'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
posted @ 2023-07-18 18:44  Carvers  阅读(120)  评论(0)    收藏  举报