Re: crontab
| From: | John Taylor-Johnston | Date: | Tue, 04 Mar 2003 21:07:12 +0000 |
| Subject: | Re: crontab | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-138172@lists.php.net to get a copy of this message | ||
Cal, Liam, Jimmy,
Thanks. If this is a serious security hazard, could you show me some code that is more secure? I am
the "root". Mind you I've never worked with crontab before. I want to run
/var/www/backup_mysql.php I suppose I should start by putting it somewhere not publicly accessible?
Thanks,
John
Liam Gibbs wrote:
> > 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.