On Thu, Jun 06, 2002 at 02:46:01AM -0700, Greg Morgan wrote: > > Take it one step at a time. I'd make a backup of the files you will be > modifying. Experiment with what you want to do as root, then worry > about the uid thing. It is not like you're going to have to send hours > reinstalling a full distro. Just hit reset if things go really bad. ;-)
Heh... Yeah you're right about that, though booting a 486 from floppy takes several *minutes*... ;) > > 1) How does cron handle itself on Bering? I.e. will it find and execute > > a user-crontab by itself? > > cron on dachstein/bering plays into your game plan. You do not have to > use crontab -e to edit the file. Here's /etc/crontab. Look at > run-parts command. ls -l cr* under /etc. It looks like you throw the > file you want executed into a directory. runparts runs all the stuff in > the directory. O.K... IINM, then what happens here is that run-parts gets called at 6:42 every morning. So then it runs whatever's in cron.daily, e.g. multicron-s and savelog-sh-httpd... But this happens every morning at *6:42* as specified in crontab, no? What I'm after is being able to set different times, for different days, something like f.x: 30 6 * * 1 uid script /usr/local/blinder/settings/monday .... 30 6 * * 5 uid script /usr/local/blinder/settings/friday 00 8 * * 6 uid script /usr/local/blinder/settings/saturday a.s.o. - which still means that I'd have to put the runtime in crontab (?) > > 2) Any tricks/hints/pointers on how to actually writing to a file? Or > > rather *modifying* a file that is already there (i.e. changing some of > > the fields in a crontab line from f.x. 30 6 * * * to 00 7 * * *) > Since you mention that your knowledge of sed is growing, that would be > your tool here. <snip> Thanks. Those region-thingies are bound to come in handy ;) As it were, I've decided to introduce an intermediate times-table, so that what I get on the webpage is: A form where I can change the settings for each of the days in the week. Upon submitting this, the table gets updated, and the page gets refreshed with the new values (read from the table). A *second* submit, that calls a write-to-crontab-script. Advantages being that - changing values for several days in one session should be a little faster (since only one file is being edited) - this table can hold values that crontab doesn't have any concept of (duration of sunrise f.x.) - everything is stored in a single place - I can do some sanity checking at this stage and last but certainly not least; In this phase of development, I can practise writing to certain fields in a file, without risking smashing crontab in the (learning) process :) > > > > 3) Are there any good candidates (scripts/routines) already present in > > Bering/packages, that I can use as starting point for 2) ? > > I think just pick a cgi page to modify. You would want some sort of > confirmation page to print in weblet. Paint the page with the normal > echos. Then echo string > desired_file_name if a whole file. Otherwise, > sed a line with your new value. Perhaps checkmem is an example. Think > of how to use the level variable. Think of above case statement and > below case statement. I'll have a looksee... sometimes it's even more confusing to try and figure out what some script does, rather than start from scratch, but in any case it's nice to have an idea about *which* script to look at ;) > I hope I complied with your wishes. Oh yes! And I very much appreciate your thoughts/comments. Actually your response has been more or less *exactly* the type I was hoping for, conceptual and non-specific :) > call pattern matching Regular Expressions. That much i *did* know... ;P > > Man, this just keeps growing... but it's *fun*! (Next thing you know, > > I'm gonna want to have the ability to specify different runtimes, for > > different days of the week ;) see? The above was yesterday, and already I've agreed that indeed this is something I need... ;D > Ummm. I don't know. Have a scheduled job to start? Pass a parameter > into job i.e. sunrise 20. Do stuff to turn motor on. After all motor > control is done call sleep with value i.e. sleep $1. Then do more > motor control to close blinds or whatever? yeah... dunno I don't think I'd thought this through. What you suggest if prolly gonna be just fine. I think I was worried because 'sleep' doesn't take smaller steps than 1 second, but in reality 1 second is more than enough 'granularity' for this purpose. I mean, I might be attempting to control the sunrise, but it's not like it's rocketscience or anything... > Have fun exploring, oh *I DO* ;) Thanx again Jon Clausen _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm ------------------------------------------------------------------------ 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
