PDA

View Full Version : modifying files like cron


killydoon
02-02-2002, 08:09 AM
Probably a pretty basic question but that's where I am. I noted in another forum that cron could be modified so that it would do its stuff at a time of day when sleep wouldn't be a problem. But even at root level, permision is denied to me. How do you modify things like cron and hostconfig?

killydoon

rusto
02-02-2002, 08:49 AM
The easiest way may be to use this GUI front end for modifying cron, Cronnix (http://www.koch-schmidt.de/cronnix/).

pmccann
02-02-2002, 10:17 AM
Not sure what you mean by "at root level" killydoon.

You should be able to edit any file with your editor of choice if you preface the command with "sudo": so to edit /etc/hostconfig I'd use

% sudo vi /etc/hostconfig
passwd: ****** [[ <-- this is *your* password being sought here ]]

[[crunch whir, crunch whir, edit edit...]] Your editor of choice may vary, but the equivalent command should work for any command line editor: pico/emacs...

One thing to note is that editing your own crontab should be done using "crontab -e" rather than editing the file in /var/cron/tabs/username (which is protected from non-superusers in any case). This installs the crontab "on the way out", but doesn't seem to be applicable to the system cron table (ie /etc/crontab), which is also in a slightly different format. (It just has one extra field: the user as which each command should be run.)

Oh yeah, for semi-completeness: bbedit users can use the command line tool "bbedit" (if you've installed it) to get at protected files: it prompts for confirmation that you want to "unlock" the file when you first make an edit, and requires authentication when you try to save the modified file.

Best wishes,
Paul

rusto
02-02-2002, 11:39 AM
Oh yeah, for semi-completeness: bbedit users can use the command line tool "bbedit" (if you've installed it) to get at protected files: it prompts for confirmation that you want to "unlock" the file when you first make an edit, and requires authentication when you try to save the modified file.

I'd love to install this...snooped around my BBedit install and haven't found out how...could you throw out a hint?

mervTormel
02-02-2002, 12:34 PM
rusto,

hint: rtfm

/Volumes/foo/xdowns/BBEdit 6.5 Demo/BBEdit Extras/Unix Tools Install Instructions

rusto
02-02-2002, 12:43 PM
Thanks for the nudge, Merv...I DID "rtfm" as indicated by the words "snooped around my BBedit install" in the post above. What I left out was that I am using BBedit 6.1 and it appears that this support was implemented in 6.5: information that would help others as well.

killydoon
02-02-2002, 01:59 PM
Thanks to both Rusto and pmccann. Cronnix works great and now I'm remembering good old vi (long forgotten after many years away from Unix).

killydoon

mervTormel
02-02-2002, 02:21 PM
Originally posted by rusto
Thanks for the nudge, Merv...I DID "rtfm" as indicated by the words "snooped around my BBedit install" in the post above. What I left out was that I am using BBedit 6.1 and it appears that this support was implemented in 6.5: information that would help others as well.

rusto, i realize you rtfm'd, but often a casual pass misses something, like "be sure to check blartywoof.com for the latest version," which isn't always a marketing tool, and which i referenced in my post by including a path to the new version poop that you needed.

i realize i was terse. as you said, it was a nudge (after all, this is a hint site ;). glad you found it and thanks for fleshing out my post.

-mt

--
information gladly given, but please refrain from talking to the bus driver. after all, he is careening about with your lives, and distractions can often lead to the single largest killer, accidents.

jmb
02-03-2002, 11:08 PM
Not sure if you people realize this, but BBEdit 6.1 can be invoked from the command line if you alias it in your .tcshrc file (assuming youve made one in your home directory). Not sure of the exact syntax, but something like:

alias bbedit 'open -a /Applications/blah/blah/BBedit\ 6.1'

should do it. This assumes, of course, that you replace /blah/blah with the actual path name. Among other things, the advantages of BBEdit 6.5 are: (1) no monkeying around to get this to be able to launch it from the terminal, and (2) you can execute terminal commands from a BBEdit shell worksheet (never tried this, but it sounds cool).

rusto
02-04-2002, 08:19 AM
Thanks, don't know why I hesitated to upgrade to 6.5 in the first place!