by The PCLinuxOS Community
Relevant to All editions of PCLinuxOS

Crontab Configuration Under Linux
Cron is a time-based job scheduler in Unix-like computer operating systems. The name cron comes from the word “chronos”, Greek for “time”. Cron enables users to schedule jobs to run periodically at certain times or dates. It is commonly used to automate system maintenance or administration, though its general-purpose nature means that it can be used for other purposes, such as backing up important data.
Each cronjob has the following syntax:

Now, below is a command to be executed.
STEP 1: Open terminal as a root/normal user and enter the following:
crontab -e 1 * * * * /bin/echo "Congratulations...!"
This will echo “Congratulations…!” every minute, and you can see this message in the user's mailbox. Save and exit the file.
STEP 2: Restart the cron daemon to make it effective, use the following command service crond restart.
What does the line actually mean?
crontab -e means to edit the user's cron file. Your cron file(s) is located at /var/lib/spool/cron
The '1 * * * *' is the time base. 1 is the number of minutes to be run. The following '* * * *' are wild cards meaning ALL so we are running this command every one minute of every hour, of every day of the month, every month of the year, and every day of the week.
If the command line is not your cup of tea, there are several good GUI programs for setting up your cron job.
Webmin is a simple way to set up cron. It is also in the Repository.

So what can cron be used for besides sending out silly little messages every minute, you ask? You can use it for almost anything. Only your mind is the limit of the things cron can do.
Automate a daily backup, send yourself reminders, create and keep your own repository up to date, or maybe …
uhhh … remind yourself to write an article for the PCLinuxOS Magazine.
If you can dream it, cron surely can do it.
|