On Feb 6, 2008 12:25 PM, Nathan Nobbe <[EMAIL PROTECTED]> 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); } ?>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to