Friday, November 8, 2013

Different way to edit crontab

Crontab is like a task scheduler in unix operating system.I expect you are already aware about crontab edit using crontab -e.

In this post I am sharing the tips how to edit crontab without using “crontab -e” command.

As we know to edit the crontab there is a command
crontab -u username -e

In Redhat, crontab files are located at /var/spool/cron and similarly , the crontab of user will be with the name of file.
for eg. username is joshiv ,and you can see the filename with joshiv in ls -l /var/spool/cron/joshiv

Like below way we can edit cron.

vi /var/spool/cron/joshiv
10 * * * * touch /tmp/log_`date +%F-%s`

No comments:

Post a Comment