Re: PHP CLI Problem

From: Date: Wed, 06 Feb 2008 17:29:45 +0000
Subject: Re: PHP CLI Problem
References: 1 2 3 4 5 6 7 8  Groups: php.general 
Request: Send a blank email to php-general+get-268796@lists.php.net to get a copy of this message
On Feb 6, 2008 12:25 PM, Nathan Nobbe <quickshiftin@gmail.com> wrote: > put the script in the webroot; then you can invoke it from cron > using curl; i imagine they have that installed. you can protect > the script with the following as the first line > if($_SERVER['REMOTE_ADDR'] !== '127.0.0.1') { die; } > > then you could hit if from cron as in > which curl > http://localhost/backup.php > > im now waiting for what will surely be moments for another member > of the list to hack this idea to pieces ;) > but it was fun to think up! No, it's a valid idea, Nate. However, additional suggestions when going this route: 1.) Stop all public output from the script, regardless of whether or not it's only allowed by localhost. 2.) Still, move the databases and backups out of the web root. 3.) Instead of using which curl in the cron, use the *nix-only GET command (case sensitive). -- </Dan> Daniel P. Brown Senior Unix Geek <? while(1) { $me = $mind--; sleep(86400); } ?>

« previous php.general (#268796) next »