- 执行
crontab -l
某次查看定时任务列表时,返回
no crontab for root
,因为这个 liunx 服务器第一次使用 crontab ,还没有生成对应的文件导致的。
- 执行
crontab -e
1 | no crontab for root - using an empty one |
选择一个编辑器,这里我选了
/usr/bin/vim.tiny
,回车。
1 | # Edit this file to introduce tasks to be run by cron. |
执行了
crontab -e
后,就生成了这个文件。