Re: crontab
| From: | Liam Gibbs | Date: | Tue, 04 Mar 2003 20:52:59 +0000 |
| Subject: | Re: crontab | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-138170@lists.php.net to get a copy of this message | ||
> Can I run a php script in crontab?
> Do I echo or print?
> Anyone doing it?
This is a serious security hazard. However, what you could do is have a PHP
page set cron settings (such as name of file, location, frequency, and
importance), then have another cron job (running at a decent frequency) do
the organization. However, this is still a security flaw, as hackers can
just take a look at your cron jobs and get in and run their own in place of
yours. Probably no more a flaw than normal, though, as if a hacker can get
in to replace your cron job, they can get in and run any number of things
anyway. Make sure to hard code your cron jobs, as having a downloadable page
is a bigger security hazard. You don't want the PHP page to do this itself,
because it will have to run as root.
I did this one time, and if I'm allowed some time to get my page up, I can
e-mail you some instructions. What you'll need is a PHP page, a txt file
(for the settings) and a cron job that will read the file and do the
necessary steps to arrange the cron jobs itself.