首页 > 系统服务 > 详细

随笔--第一次使用crontab linux选择编辑器问题

时间:2019-08-04 18:27:32      阅读:135      评论:0      收藏:0      [点我收藏+]

第一次使用crontab 时,会出现:
no crontab for root - using an empty one

“Select a editor ......”下面有几个选项,就是叫你选择编辑器。(选vim)就可以了,我选的第三个。

但是如果你选错了,就可能会遇到点麻烦,没有办法正常编辑,crontab -e。

怎么办?
执行这个命令:

select-editor (针对crontab的一个命令), 可以让你重新选一次。

crontab: "/usr/bin/sensible-editor" exited with status 1
root@ip82:/home/user# select-editor

Select an editor. To change later, run ‘select-editor‘.
1. /bin/ed
2. /bin/nano <---- easiest
3. /usr/bin/vim.basic
4. /usr/bin/vim.tiny

Choose 1-4 [2]: 3
root@ip82:/home/user# crontab -e
no crontab for root - using an empty one

设置crontab时,可能会操作的
设置默认编辑模式 vim /etc/profile 增加EXPORT EDITOR=vim
VIM /etc/cron.allow, vim /etc/cron.deny

crontab -e结果存放在/var/spool/cron/crontabs中

随笔--第一次使用crontab linux选择编辑器问题

原文:https://www.cnblogs.com/gxyandwmm/p/11298898.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!