> 
> Deirdre Saoirse wrote:
> > 
> > On Sat, 16 Jan 1999, Chip Rose. wrote:
> > >I use the rdate program.  Not automatic, I type <rdate -s time.nist.gov>
> > >as root, and the system clock is updated - only use it once in a while
> > >when the clock is off.
> > 
> > Thank you! I have a clock that loses time on one of my computers and running
> > this as a cron job will fix that problem. :)
> > _Deirdre  
> 
> I apologize if this is a dumb question, but what's a cron job?
> 
> Stan Fisher
> 

A cron job ussually is a program or a script that runs at N time.  Most
systems have cron jobs that run at night to trim  some of the log files so
that they dont get huge, alot of time peopel will put a script to backup
important files during 'non-peak' hours, some check for security issues.

cron jobs are really fun.  There isn't a program that is actually called
cron, there is the cron dameon (crond I think) and crontab

crontab is used to create, edit, remove and listed cron jobs. Differant
users can have there own cron jobs.  There should be a file called
/var/cron/deny that you can edit, to choose which users on your system can
run cron jobs.

Every jobs should be edited though crontab so they system can vefify that
it is in the proper format and also make the cron daemon aware of the
newly create (updated) jobs.

crontab -e will edit your crontab file, which might or mightnot have
anything already in it.  Some dist have predefined jobs set up when you
install it on your system, to clean log files, etc..

The file has to be in a certain format so the cronb can read it, first
there is the when to do, and what to do.  this is taken from the man page
15 3 * * 1-5 find $HOME -name core 2>/dev/null |  xargs rm -f

Every weekday morning at 3:15 it will clean up some files.  Truly the
hardest part about cron jobs is getting the format down right, it kinda
tricky.

crontab -l lists the cron jobs for the user you are loged in as crontab
[user] -l is you are root will show that users cron jobs.

crontab -r will remove your 'jobs' file, use carefully!

You might want to read the man pages they can explain it alot better than
I can.  Alot of sys adim books also should have a short note about it.
man cron
man crontab

There is also the AT daemon that will run programs or scripts AT N time, I
haven't used this to much other to see if it works, but that is also could
be usefull.

Bud

Reply via email to