The cron system daemon wakes up for every minute and executes all the scheduled commands. It looks at user specific jobs along with system specific jobs defined in /etc/cron.d directory. The “crontab” command can be used add a user specific cron job.

Run “crontab -e” which opens an editor with a list of user specific jobs defined one per each line. If it is the first time you are running, you would probably see it blank. Just add the following aentry and replace the command with whatever you would like to run each minute.

Use the following command to edit user specific cron jobs.

[neo@techpulp ~]# crontab -e

Add the following entry in the editor in a separate line.

* * * * * echo `date` >> /home/neo/times.txt

You can verify if it is added properly using the following command.

[neo@techpulp ~]# crontab -l
* * * * * echo `date` >> /home/neo/times.txt
[neo@techpulp ~]#

The above job just appends output of date command for each minute to a file /home/neo/times.txt. You will see that file created and five minutes you will see something similar to the following.

[neo@techpulp ~]# cat /home/neo/times.txt
Sat Dec 6 04:06:01 IST 2008
Sat Dec 6 04:07:01 IST 2008
Sat Dec 6 04:08:01 IST 2008
Sat Dec 6 04:09:01 IST 2008
[neo@techpulp ~]#

If you don’t want your specific crontab entries, you can remove them using following command.

[neo@techpulp ~]# crontab -r
[neo@techpulp ~]#