rbt <[EMAIL PROTECTED]> writes:

> How can I safely append a crontab entry to a crontab file
> progammatically with Python?

Well, one way would be to invoke the system crontab utility and use an
"editor" that passes the file to your program, and reads the results
back.

> I need to handle crontabs that currently have entries and crontabs that
> are empty. Also, I'd like this to work across Linux and BSD systems.
>
> Any pointers?

I think most Free Unix systems use the Vixie cron, and the non-free
ones have a "crontab" command (do some of them call it cron?) with the
same API. So you're pretty safe using that.

If you want to assume that you're going to have the vixie cron, you
could dig into it's guts to see what it does for locking, and do that
by hand.

   <mike
-- 
Mike Meyer <[EMAIL PROTECTED]>                  http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to