FRANK DELATORRE wrote:
Hello,

I hope this is the right forum to ask this question:

Is it possible to generate a crontab file from a perl driven CGI
script?

If so, what are the key steps?

I've been thinking about how to develop this but for some reason I
cannot rectify, in my head, how to edit a crontab file as www when www
is not really a user in the /home dir...

Typically you would use the crontab(1) program to submit a new crontab. If you need to get the current crontab first, use crontab -l. Obviously you can't use crontab -e from a script.


So,

  # read current crontab
  my @lines = `crontab -l`;

  ... change @lines as necessary ...

  # submit updated crontab
  open F, "|crontab" or die $!;
  print F @lines;
  close F;

HTH


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to