LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   crontab (https://www.linuxquestions.org/questions/linux-newbie-8/crontab-896171/)

niharikaananth 08-08-2011 07:30 AM

crontab
 
Hi....when I type "crontab -e" to edit the file, it is not opening in the editor & showing output as "285". I just wanted to edit crontab, So could anybody please tell me which is the real file of crontab, so I can manually edit that file using vi editor or nano. Or if that default editor is corrupted when I type "crontab -e", how can I change default editor before using "crontab -e" command. I will be waiting for your kind reply.

Regards
Niharika

berbae 08-08-2011 07:42 AM

man crontab:
Quote:

Generally the -e option is used to edit your crontab. crontab will use the editor specified by your EDITOR or VISUAL environment variable (or /usr/bin/vi) to edit the crontab.

nkd 08-08-2011 09:23 AM

hi,

On my system (ubuntu 10.10) the crontab -e opens up a menu to choose the shell from and it works fine.
By the way, I hope you understand what the command does ?!
Quote:

It creates a crontab file for the user in the /var/spool/cron/crontabs/ folder and the file has the name of the user
The main or system level crontab file is the /etc/crontab file. So you may directly edit it using gedit or vi or nano or emacs. Warning :- Do this only if you know what you are upto.

If you are trying to create and execute a script to do a cron job :-
Quote:

In the /etc directory you will probably find some sub directories called
'cron.hourly', 'cron.daily', 'cron.weekly' and 'cron.monthly'.It will be run either hourly, daily,
weekly or monthly, depending on the name of the directory.
Plz check out this nice link.

Hope it helped
bye
nishith


All times are GMT -5. The time now is 11:03 AM.