Home > How To > Running Crontab

Running Crontab

My Previous post talks about sending automated emails using mutt.

How do we automate this process say every hour
Then we setup crontab to get this up and running.
Below are few of the options which crontab gives.
crontab -e Edit your crontab file, or create one if it doesn’t already exist.
crontab -l Display your crontab file.
crontab -r Remove your crontab file.
crontab -v Display the last time you edited your crontab file.
Steps
  1. Enter: $ crontab -e
  2. If you have not configured EDITOR it will ask for it set which ever you are comfortable with.
  3. Enter your time to execute command information, below is how you give it.
———————————————-

———————————————-
# Every Minute
# m h dom mon dow command
* * * * * /home/ahmed/executeMyMuttScript.sh
———————————————-
# Every Hour at zero minute
# m h dom mon dow command
0 0-23 * * * /home/ahmed/executeMyMuttScript.sh
———————————————-
# Every Hour at 30th minute (1:30, 2:30, 3:30 …)
# m h dom mon dow command
30 * * * * /home/ahmed/executeMyMuttScript.sh
———————————————-
Advertisements
Categories: How To
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: