Python and cron jobs.

Fazer faizan at jaredweb.com
Tue Aug 5 13:47:28 EDT 2003


Steven Taschuk <staschuk at telusplanet.net> wrote in message news:<mailman.1060068188.30327.python-list at python.org>...
> Quoth Fazer:
> > I am wondering that if it is possible to add cron jobs via a web or
> > shell interface?  I can make Python act as a shell script and be
> > called by a PHP script.  But my main goal here is to be able to manage
> > cronjobs.  Add or remove certain crjob jobs etc...
> > 
> > Can any kind soul shed some light on how I would accomplish this?
> 
> The question is a bit vague, I'm afraid.
> 
> If you just want to know how to invoke crontab(1) from a Python
> script, look up os.popen() and friends in the standard library
> documentation.  As for getting the cron daemon to reload the
> changed crontab, that's a nop in the crons I've seen; they check
> for changes every minute anyway.
> 
> If you want to know something else, please specify.

Hello and thanks for your reply!

Actually, I think I will open the crontab file as a file and do the
changes that way because this would also involve in the deletion of
some cronjobs.  I just wish to know how to get the cron deamon to
reload the crontab.  Are you certain that it checks for changes or
reloads every minute?




More information about the Python-list mailing list