Gentoo Archives: gentoo-dev

From: Ryan Reich <ryan.reich@×××××.com>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: Re: Re: Inotify and (f)crontabs
Date: Sat, 07 Jul 2007 15:41:27
Message-Id: 2bd962720707070836q6e2d02d3k1abdb5997b954acc@mail.gmail.com
In Reply to: [gentoo-dev] Re: Re: Re: Inotify and (f)crontabs by Steve Long
1 On 7/6/07, Steve Long <slong@××××××××××××××××××.uk> wrote:
2 > Ryan Reich wrote:
3 > <snip useful discussion that went over my head>
4 > >
5 > > If there's interest in incorporating this, I wouldn't mind testing my
6 > > idea. Once I get past the initial resistance to doing anything at
7 > > all, it's probably two minutes' compilation time plus two more writing
8 > > the config files to set up.
9 > >
10 > I think I should point out that comments like that really get people's backs
11 > up; if it's so quick and easy why didn't you implement it first and then
12 > ask for comments on a working project? If you only wanted discussion then
13 > cool, you got it ;)
14 >
15 > Please do post a follow up with a link to the working code.
16 >
17 > (BTW my 5 minute projects always take weeks.. ;)
18
19 I don't know if I got anyone else's back up with this, but you got
20 mine up with your letter :) So I wrote an ebuild for incron (though I
21 notice that there's an extremely minimal one pending on
22 bugs.gentoo.org). It includes, in addition to the actual ebuild file,
23 a boot script, an incrontab similar to the one I conceptualized in one
24 of my earlier letters, and a little script that handles files in
25 /etc/cron.{hourly,...}. I've tested it on my machine (indeed, I'm
26 running it now) and it does work. Basically, the incrontab (called
27 "fcrontabs" and which goes in /etc/incron.d) runs my little script to
28 generate a one-line fcrontab which it puts in /etc/cron, whenever it
29 sees something change in one of the cron.timely directories; the
30 one-liner just runs the script which changed. It also makes
31 check_system_crontabs the responsibility of incrond. The net result
32 is that adding anything to any /etc/cron.timely/ results in a periodic
33 fcron job, like
34
35 @ 1d makewhatis -u
36
37 being added to the fcrontab for "systab" immediately. The contents of
38 /etc/crontab and /etc/fcrontab are redundant under this scheme and the
39 files should be emptied if this is used.
40
41 I've tarred and bzipped the whole ebuild directory and attached it;
42 it's only four kilobytes so I hope no one minds (this letter is
43 probably longer). I don't know where the correct forum to submit this
44 sort of thing for comment is, so if this isn't it I'd be happy to take
45 it somewhere else. But I thought anyone following this discussion
46 would like to see it here.
47
48 --
49 Ryan Reich

Attachments

File name MIME type
incron-ebuild.tar.bz2 application/x-bzip2

Replies

Subject Author
Re: [gentoo-dev] Re: Re: Re: Inotify and (f)crontabs Ryan Reich <ryan.reich@×××××.com>