Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When issuing crontab -e as root , i always got messages like the following (partial) , however , executing vim directly doesn't have problems at all. $EDITOR was set to vim in /root/.bash_profile already.

%> sudo crontab -e
Error detected while processing /root/.vimrc:
line    2:
E319: Sorry, the command is not available in this version: autocmd! BufNewFile * silent! 0r ~/.vim/skel/tmpl.%:e
line   20:
E319: Sorry, the command is not available in this version: autocmd VimEnter * set vb t_vb=
line   57:
E518: Unknown option: autochdir
line   65:
E319: Sorry, the command is not available in this version: syn on
line   78:
E538: No mouse support: mouse=a
line   79:
E319: Sorry, the command is not available in this version: filetype plugin indent on
line   87:
E319: Sorry, the command is not available in this version: funct! CommentBlock(comment)
line   88:
share|improve this question
up vote 1 down vote accepted

When you use "sudo command" the root user profile is not loaded, use sudo -i and crontab -e instead.

share|improve this answer
    
no difference with sudo -i crontab -e – warl0ck Oct 16 '11 at 15:48
    
Sorry, I was not very clear, you need to: "sudo -i" ENTER, then contrab -e. "sudo -i command" will not load the root's .bashrc, that is why the EDITOR is not being properly set. – João Pinto Oct 17 '11 at 8:24
    
not work as well , also i tried to 'Default env_keep = EDITOR' with visudo , it's still not working , but 'sudo su -' , and then 'crontab -e' works – warl0ck Oct 17 '11 at 15:24
    
[Running 14.04. Desktop LTS:] Isn't there a simpler way than $ sudo -i followed by $ crontab -e followed by choosing yr editor of choice ? It seems that loading root's .bashrc when invoking sudo + cmd should be accessible to permanent configuration. Should not there be at least an option for that ? – Cbhihe Jan 12 at 10:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.