Asked by Waman R. Kumar
Q. Ok, let me confess first, it was question asked in Linux job interview. Question was after typing crontab -u user -e or crontab -e command system gave back some error code to user, he further told me that crond and and other utilities are installed. How to fix this problem? Not to mentioned I was unable to answer question. So what is the solution to such unseen problem?
A. crontab is the program used to install, deinstall or list the tables used to drive the cron daemon/service in Vixie Cron. Each user can have their own crontab, and though these are files in /var/spool/cron/crontabs (under Debian), they are not intended to be edited directly. So first you use crontab -e command. If variable EDITOR is not defined in your environment you will use ed text editor – it is a line-oriented text editor. Try following (under BASH)
$ export EDITOR=ed
$ crontab -u user -e
70 ?
Type q and hit enter to exit. Now setup EDITOR to vim
$ export EDITOR=/usr/bin/vim
$ crontab -u user -e
Now it will open in vim/vi text editor. This kind of questions asked in Linux/UNIX job interview to test your basic knowledge of Operating system. So it is always good idea to define EDITOR variable in you shell startup file such as .bash_profile.
And, yes you can use use crontab command with sys account too:
# crontab -u sys -e
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop



![Learning and Mastering the Linux VI / VIM Editor [ PDF version ]](http://s0.cyberciti.org/images/rp/1/23.jpg)









{ 1 comment… read it below or add one }
A few typos:
- “Debina” instead of “Debian”
- “enviorment” instead of “environment”
Otherwise… Thumbs up Vivek!