Crontab (Cron Table):

One of the best utility I became familiar with.

What is it?

It’s unix, solaris utility that allows tasks to be run automatically run in the background at regular intervals by the cron deamon. These tasks are termed to be cron jobs.

Since everything in unix is a file then Where do you find this file?

By default crontab file is located in /var/spool/cron/crontabs/$User.
Where $User is you, yes every user has its own crontab file. That helps in every user able to schedule their tasks.

I am not able to execute CronTab. What’s the problem?

If you are not able to execute crontab then you have been restricted to use crontab. To start using it you can remove your name from /usr/lib/cron/cron.deny.
There are two files that exist with crontab.
/usr/lib/cron/cron.allow: allows you to use the crontab.
/usr/lib/cron/cron.deny : denies execution of crontab.

If only cron.deny exists and is empty then all users can use crontab.
If neither file exists, only the root user can use crontab. The allow/deny files consist of one user name per line.

How to use it?

you can pretty much use any editor eg: vi, nano etc.

Crontab -e : Edit your crontab, or create one if it doesn’t already exists.
Crontab -i : Display your crontab file.
Crontab -r : Remove your crontab file.
Crontab -v : Display the last time you edited your crontab file.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: