[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: "green" linux user needs CRON clarification




On Tue, 16 Feb 1999, William Schwartz wrote:

> There is a filed called "crontab" in the "etc" directory. That is my "system
> wide" crontab. This file I am able to edit and modify...
> 
> then there are crontab files in the "/var/spool/cron/crontabs" directory
> that are to be edited with the crontab command...
> 
> The "crontab" file in the "etc" directory has a parameter called "user". and
> I use it to specify "root" because I need to schedule a job as root...
> 
> I guess my question is: what is the difference between the two? and which
> one should I use? I need a program to run every 5 minutes to do some
> polling. and I want it to happen 24/7.
> 

I would accomplish this using the crontab command. crontab allows a user
to access cron by manipulating (creating, listing, removing) crontab
files. For example, at home I set up a crontab file to get my email from
my ISP using fetchmail. I create a file in my account that is in the
crontab format and then use the command 'crontab cronfile' (where
'cronfile' is the aformentioned crontab file) to create the crontab file
and therefore have cron operate on it.

For system wide things, I've done the same thing as root. I'm not sure
that this is "the right way" but it works just fine. This seems more
straightforward to me than modifying the crontab files in the system,
mostly because I like to set things up so that upgrading a distribution
doesn't wipe out any changes I have made to the system files. I've never
modified the system crontab files and have been able to do whatever I
wanted to cron. However, I'm less sure that this is "a bad thing" because
some packages do exactly this when they are installed.

Hope this helps a little...



Reply to: