On Thursday 20 June 2002 07:19, Jon Clausen wrote:
> Jeff's post, however, has made me realize that maybe this is not such
> a great way of getting said timestamp updated after all. And that
> Eric's suggestion of having a small C-executable (suid) perform the
> actual operation instead, is probably better. I'm thinking that
> having the paths/filenames hardcoded into the C-executable might be a
> way of minimizing the potential abuse of such a program(?)
Definately!
> *) What I do is this:
> Rather than edit the file in-place, I generate a new one in a
> temporary location, remove the old file, and copy the new one to the
> crontabs/ dir.
Just copying over the old one from the /tmp file would save a few lines.
I generally do this step with a "save" or "commit changes" option you
can also code it to do a backup of the package with this step.
> Thirdly, if the programs are set (via the webinterface) to *not* run
> on specified day(s), it's *much* simpler if the script which builds
> the new crontab just skips writing those entries, instead of writing
> them, but #'ing them out.
I would setup a seperate /tmp file for every web page, so when you
only change one or two things, you don't need to regenerate the
whole config again. As far as shell scripting this, the forms should
send whatever option to the file you define, so leaving commented
options in serves no point other than code-bloat unless your planning
on hand-editing the config file(s).
> Fourth, a table with a given delimiter (':' f.x.) is *way* easier to
> both parse, *and* update.
as opposed to space delimiting or line delimiting..... I dunno about
that in a shell (depending on how you named you variables).
> This may be 'baby' programming, but it works. :)
That is the point!
> Guess I'm going to have to learn a little C next ;D
Sounds like fun! There is enough source code for Linux
programs to learn how to code about anything! C isn't
terribly difficult to learn if you can figure out with functions
you want to use and what library they are in ;-)))
--
~Lynn Avants
aka Guitarlynn
guitarlynn at users.sourceforge.net
http://leaf.sourceforge.net
If linux isn't the answer, you've probably got the wrong question!
-------------------------------------------------------
Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
------------------------------------------------------------------------
leaf-user mailing list: [EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/leaf-user
SR FAQ: http://leaf-project.org/pub/doc/docmanager/docid_1891.html