Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Jul 1999 14:03:16 -0700 (PDT)
From:      Doug <Doug@gorean.org>
To:        Sue Blake <sue@welearn.com.au>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: adding to periodic/weekly
Message-ID:  <Pine.BSF.4.05.9907271354400.1387-100000@dt011n65.san.rr.com>
In-Reply-To: <19990728030422.I7349@welearn.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 28 Jul 1999, Sue Blake wrote:

> I want to add some maintenance tasks to be run weekly (maybe daily ones too).
> There seem to be at least five ways to do this:

	Actually there is just one way. All of the solutions below depend
on cron. 

> Just add it to the system crontab
>  - Can run at a different time, if necessary. Leaves periodic unmolested.
>  - Separates it from other weeklies, could become lost or confusing.

	This would be my preference, if for no other reason than because I
don't like adding more files to /etc. 

> Add it to /etc/periodic/weekly/999.local
>  - This might be what the file is intended for.
>  - Maybe I shouldn't clutter that file.

	I wouldn't do this, since this file's only function in each
directory is to call the corresponding .local script, and it makes
updgrading your system that much more complicated. 

> Create /etc/weekly.local and put it in there
>  - It's tempting because 999.local picks it up if present.
>  - Comment says this is only for backward compatibility.

	Comments like that are usually sour grapes from committers who
weren't able to fully persuade everyone to follow their new idea. :)
However I object to the .local idea on the basis above, adding more files
to /etc. 

> Add another file /etc/periodic/weekly/<high number>.whatever
>  - Can keep it away from existing sequence, or insert if necessary
>  - Future upgrades might add files using the numbers I choose

	Being able to sequence the jobs is the only virtue of this
solution. As mentioned, duplicate numbers aren't a problem. If it works
the same way solaris does, they are executed in alphabetical order. 

> Put it in a numbered file under /usr/local/etc/periodic/weekly/
>  - This seems to be what it's intended for, but nobody said I could

	Nobody said you can't either. :) It's your system, do whatever you
want with it. 

>  - Path is already in rc.conf but doesn't exist, not sure why not used
>  - Can't find doc on its use, e.g. run in path order? unique numbers required?

	Take a look at the man page for periodic and search for the world local.

	If you haven't already guessed, I'm heavily in favor of using the
system crontab, since that's what it's for on a BSD system. Alternatively
you could use root's crontab if you wanted to be more sysV'ish, but I
would put messing with /etc/periodic at a distant last. 

Good luck,

Doug
-- 
On account of being a democracy and run by the people, we are the only
nation in the world that has to keep a government four years, no matter
what it does.
                -- Will Rogers



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9907271354400.1387-100000>