* [gentoo-user] Daily dumb question... chron.
@ 2005-07-18 12:06 Steve [Gentoo]
2005-07-18 12:25 ` Hans-Werner Hilse
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Steve [Gentoo] @ 2005-07-18 12:06 UTC (permalink / raw
To: gentoo-user
Because I need my Gentoo server to perform periodic tasks on my behalf I
new I needed some implementation of "cron" - and after a brief
investigation I settled on fcron as I liked the idea that I could give
flexible scheduling in order to allow the OS to delay processing in the
event of heavy system load. I've written a couple of my own
administration tasks (to be run as my own non-root user) and these work
fine.
I've noticed the directories /etc/cron.daily; /etc/cron.hourly;
/etc/cron.monthly etc. and therein a bunch of non-user-specific
administration tasks... For example, in ./etc/cron.daily I've
logrotate.cron and rulesdujour - but none of these appear to have run in
the last month. Are thse system tasks supposed to be fired
automatically by fcron? What would be the easiest way to get all my
periodic system administration tasks defined in these directories to be
fired automatically? Did I make a sensible choice with fcron?
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-user] Daily dumb question... chron.
2005-07-18 12:06 [gentoo-user] Daily dumb question... chron Steve [Gentoo]
@ 2005-07-18 12:25 ` Hans-Werner Hilse
2005-07-18 12:58 ` Dave Nebinger
2005-07-19 0:52 ` Bob Sanders
2 siblings, 0 replies; 6+ messages in thread
From: Hans-Werner Hilse @ 2005-07-18 12:25 UTC (permalink / raw
To: gentoo-user
Hi,
On Mon, 18 Jul 2005 13:06:29 +0100
"Steve [Gentoo]" <gentoo_steve@shic.co.uk> wrote:
> I've noticed the directories /etc/cron.daily; /etc/cron.hourly;
> /etc/cron.monthly etc. and therein a bunch of non-user-specific
> administration tasks... For example, in ./etc/cron.daily I've
> logrotate.cron and rulesdujour - but none of these appear to have run in
> the last month. Are thse system tasks supposed to be fired
> automatically by fcron? What would be the easiest way to get all my
> periodic system administration tasks defined in these directories to be
> fired automatically? Did I make a sensible choice with fcron?
Can't tell much about fcron (esp. if its config syntax is similar to my
vixie-cron), but for me, vixie-cron installed a /etc/crontab that
contains the following lines:
0 * * * * root rm -f /var/spool/cron/lastrun/cron.hourly
1 3 * * * root rm -f /var/spool/cron/lastrun/cron.daily
15 4 * * 6 root rm -f /var/spool/cron/lastrun/cron.weekly
30 5 1 * * root rm -f /var/spool/cron/lastrun/cron.monthly
*/10 * * * * root test -x /usr/sbin/run-crons && /usr/sbin/run-crons
this does the job.
-hwh
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [gentoo-user] Daily dumb question... chron.
2005-07-18 12:06 [gentoo-user] Daily dumb question... chron Steve [Gentoo]
2005-07-18 12:25 ` Hans-Werner Hilse
@ 2005-07-18 12:58 ` Dave Nebinger
2005-07-18 13:09 ` Dave Nebinger
2005-07-19 0:52 ` Bob Sanders
2 siblings, 1 reply; 6+ messages in thread
From: Dave Nebinger @ 2005-07-18 12:58 UTC (permalink / raw
To: gentoo-user; +Cc: gentoo_steve
> Are thse system tasks supposed to be fired
> automatically by fcron?
You missed the message that flew by when emerging fcron...
Fcron includes the /etc/cron.* directories but does not install cron jobs
for them automatically, and it does not support /etc/crontab (as other crons
do).
You need to manually add them to the root crontab. Easiest way would be to:
1. su - (or login as root).
2. crontab -l root > root.crontab (to get any existing cron entries for
root).
3. vi root.crontab and add the following:
# Clean the lastrun directories...
0 * * * * rm -f /var/spool/cron/lastrun/cron.hourly
1 3 * * * rm -f /var/spool/cron/lastrun/cron.daily
15 4 * * 6 rm -f /var/spool/cron/lastrun/cron.weekly
30 5 1 * * rm -f /var/spool/cron/lastrun/cron.monthly
# Now do the command to determine what tasks need to be executed
# Only generate emails on errors...
!nolog(true)
*/10 * * * * /usr/bin/test -x /usr/sbin/run-crons &&
/usr/sbin/run-crons
4. crontab root.crontab (to make the changes take effect)
This will install the appropriate cron jobs to have the /etc/cron.* scripts
run.
Dave
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [gentoo-user] Daily dumb question... chron.
2005-07-18 12:58 ` Dave Nebinger
@ 2005-07-18 13:09 ` Dave Nebinger
0 siblings, 0 replies; 6+ messages in thread
From: Dave Nebinger @ 2005-07-18 13:09 UTC (permalink / raw
To: gentoo-user; +Cc: gentoo_steve
>
> # Now do the command to determine what tasks need to be executed
> # Only generate emails on errors...
> !nolog(true)
Oops, this nolog bit comes from my crontab and is not normally put in. I
added it because I hated getting emails for regular runs. If you choose to
include it, add "!reset" to the line after the run-crons line of the text I
sent.
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-user] Daily dumb question... chron.
2005-07-18 12:06 [gentoo-user] Daily dumb question... chron Steve [Gentoo]
2005-07-18 12:25 ` Hans-Werner Hilse
2005-07-18 12:58 ` Dave Nebinger
@ 2005-07-19 0:52 ` Bob Sanders
2005-07-19 10:36 ` Steve [Gentoo]
2 siblings, 1 reply; 6+ messages in thread
From: Bob Sanders @ 2005-07-19 0:52 UTC (permalink / raw
To: gentoo-user
On Mon, 18 Jul 2005 13:06:29 +0100
"Steve [Gentoo]" <gentoo_steve@shic.co.uk> wrote:
ne.
>
> I've noticed the directories /etc/cron.daily; /etc/cron.hourly;
> /etc/cron.monthly etc. and therein a bunch of non-user-specific
> administration tasks... For example, in ./etc/cron.daily I've
> logrotate.cron and rulesdujour - but none of these appear to have run in
> the last month. Are thse system tasks supposed to be fired
> automatically by fcron?
Yes. In the ebuild it says -
einfo "To activate /etc/cron.{hourly|daily|weekly|montly} please run: "
einfo "crontab /etc/crontab"
> What would be the easiest way to get all my
> periodic system administration tasks defined in these directories to be
> fired automatically? Did I make a sensible choice with fcron?
>
I just add the tasks to s specific script in the appropriate account and insure the
script is executable. It all works fine with fcron.
Bob
-
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-user] Daily dumb question... chron.
2005-07-19 0:52 ` Bob Sanders
@ 2005-07-19 10:36 ` Steve [Gentoo]
0 siblings, 0 replies; 6+ messages in thread
From: Steve [Gentoo] @ 2005-07-19 10:36 UTC (permalink / raw
To: gentoo-user
Bob Sanders wrote:
>>Are thse system tasks supposed to be fired automatically by fcron?
>>
>>
>Yes. In the ebuild it says -
> einfo "To activate /etc/cron.{hourly|daily|weekly|montly} please run: "
> einfo "crontab /etc/crontab"
>
>
I hadn't seen that message - but then again, when I installed fcron the
/etc/cron.* stuff wasn't especially important to me... so I might easily
have ignored it at the time. It's a pity this sort of "essential"
warning isn't available for all packages as some kind of Gentoo
knowledge base - I guess I could read the ebuild files - but it would be
far more convenient to have tips/tricks/gotchas available annotated with
each package - say on http://packages.gentoo.org/... Hmmm.
In any case, thanks - "crontab /etc/crontab" seems the perfect resolution.
Steve
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-07-19 10:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-18 12:06 [gentoo-user] Daily dumb question... chron Steve [Gentoo]
2005-07-18 12:25 ` Hans-Werner Hilse
2005-07-18 12:58 ` Dave Nebinger
2005-07-18 13:09 ` Dave Nebinger
2005-07-19 0:52 ` Bob Sanders
2005-07-19 10:36 ` Steve [Gentoo]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox