[GLLUG] crontabs

Sean picasso at madflower.com
Tue Jun 10 20:55:52 EDT 2003


You have to HUP crond if  you directly edit it. Given that this is a web 
application and probably (advisably) not running as root that might be 
more difficult to do.

Now you might be able to set your EDITOR to your script. 
so like 
#!/bin/sh 
EDITOR=Myscript.sh
crontab -e 

and I am assuming possibly incorrectly that cron will open the EDITOR
program with the argument of the crontab file and when your script exits
it will properly save the crontab for you and reread the crontab for you.

like where Myscript.sh is like:
#!/bin/sh
mv NewCronTab  $1



On Tue, 10 Jun 2003 bfdamkoehler at worldnet.att.net wrote:

> Todd Torrey wrote:
> > I was wondering if directly editing a crontab without using "crontab" is 
> > strictly prohibited.
> > I want to be able to edit a crontab via a script without any user 
> > interaction. Is this o.k.?
> > To be more specific about my intentions, I want to serve a web page 
> > showing the contents of a crontab and also allow editing the crontab via 
> > a web form.
> > 
> > Thanks,
> > Todd
> > 
> > _________________________________________________________________
> > Add photos to your messages with MSN 8. Get 2 months FREE*.  
> > http://join.msn.com/?page=features/featuredemail
> > 
> > _______________________________________________
> > linux-user mailing list
> > linux-user at egr.msu.edu
> > http://www.egr.msu.edu/mailman/listinfo/linux-user
> > 
> 
> 
> Sure. If you don't already have the crontab in its own file you get a 
> copy into a temp file, edit that and then resubmit it via something like:
> 
>      crontab -l >crontab.tmp
>      edit crontab.tmp in whatever way you want
>      crontab crontab.tmp
>      rm crontab.tmp
> 
> If you already have the crontab in its own file you can just do this:
> 
>      edit your_crontab_file in whatever way you want
>      crontab your_crontab_file
> 
> 
> 
> 
> _______________________________________________
> linux-user mailing list
> linux-user at egr.msu.edu
> http://www.egr.msu.edu/mailman/listinfo/linux-user
> 



More information about the linux-user mailing list