The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 12-28-2003
google's Avatar
google google is offline
Moderator
 

Join Date: Jul 2002
Location: Atlanta
Posts: 740
check out cron, whick is the unix scheduler. It should do the trick for you. From the command line man cron

Read More

Cron
This file is an introduction to cron, it covers the basics of what cron does,and how to use it.

What is Cron?
Cron is the name of program that enables unix users to execute commands or scripts (groups of commands) automatically at a specified time/date. It is normally used for sys admin commands, like makewhatis, which builds a search database for the man -k command, or for running a backup script, but can be used for anything. A common use for it today is connecting to
the internet and downloading your email.

minute hour dom month dow user cmd
# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

minute This controls what minute of the hour the command will run on, and is between '0' and '59'
hour This controls what hour the command will run on, and is specified in the 24 hour clock, values must be between 0 and 23 (0 is midnight)
dom This is the Day of Month, that you want the command run on, e.g. to run a command on the 19th of each month, the dom would be 19.
month This is the month a specified command will run on, it may be specified numerically (0-12), or as the name of the month (e.g. May)
dow This is the Day of Week that you want a command to be run on, it can also be numeric (0-7) or as the name of the day (e.g. sun).
user This is the user who runs the command.
cmd This is the command that you want run. This field may contain multiple words or spaces.

If you don't wish to specify a value for a field, just place a * in the
field.