Linux定时任务Crontab使用 提示no crontab for root

crontab -e

输出如下

no crontab for f - using an empty one

Select an editor.  To change later, run 'select-editor'.
  1. /bin/ed
  2. /bin/nano        <---- easiest
  3. /usr/bin/vim.tiny
Choose 1-3 [2]: 3
crontab: installing new crontab
 

然后就会打开一个文件,什么都不用做,直接保存,保存方式类似vim

再次crontab -l ,就会显示出定时任务了

原文地址:https://www.cnblogs.com/sea-stream/p/9955716.html