Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am really not familiar with linux, and only started using it recently, so be patient with me. I am trying to control a camera on regular intervals through a script that is called upon in the crontab. When I start up the computer, I can open crontab, edit and save, and everything is executed correctly. However, I can never open crontab a second time, unless I restart the computer first. If I type crontab -e, I get a blank page, located in the /tmp directory. I can enter my commands in there, but cannot save it.

I don't know if this is relevant, but when I try sudo crontab -e, I get something like "no cron installed for root".

Any help is really appreciated!

Sarah

[edit] Problem solved: the problem was the editor (gedit), when using nano as editor, I can access crontab, edit and save without problems!

share|improve this question
1  
welcome to askubuntu! please post your solution as an answer below - it's okay to answer your own questions here. –  ImaginaryRobots Nov 22 '12 at 18:08
    
Problem solved: the problem was the editor (gedit), when using nano as editor, I can access crontab, edit and save without problems! –  Sarah Nov 27 '12 at 15:33
add comment

1 Answer

The crontab -e command will check the environment variables $EDITOR and $VISUAL for an override of the default text editor, so...
Two of the many other possible ways can be applied:

1. Either: Run select-editor command on terminal (you can get a terminal by pressing Ctrl+Alt+T) as below

$ 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]: 

The default here is chosen as 2 mentioned in the square bracket. Your answer will take the default to run with crontab -e when run independently.

2. OR: (This is my personal fav.) Choose one of the following to override default editor:

$ export EDITOR=nano

or

$ export VISUAL=nano  

Of course, this #2 choice you can make permanent by putting it on your .bashrc or .bash_profile.

share|improve this answer
add comment

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.