Cron methods for backup module
I'm trying 2 methods to run a backup cron via the backup module.
The 1st is using the CLI. This results in "undefined index" errors for SCRIPT_NAME, SERVER_NAME, SCRIPT_FILENAME, SERVER_NAME & URI_PATH in fuel/modules/fuel/config/fuel.php & fuel_constants.php
/usr/bin/php /home/xxxx/public_html/index.php backup/cron
I read the instructions about setting these in index.php, but it seems to me that if the values (the defaults) already there were available, the errors might not exist or would be different?
The 2nd method is using wget which very nearly works - I have the remote webhook set up for the server, but it is always redirected to the login. Isn't the webhook array there to bypass the need to login? In the array I have the remote IP, the internal IP and for good measure, 127.0.0.1 (which is probably unnecessary).
I've got the Fuel cron backup routine working on other servers, but with older versions of Fuel. What am I missing this time?
Thanks in advance.
Comments
if (defined('STDIN'))
TO
if (php_sapi_name() === 'cli' OR defined('STDIN'))
I would think the opposite though and would allow for situations where before it wouldn't.
If it were me, I'd debug to see if it's going into that "if" conditional to set those $_SERVER variables, and if not, look into other reasons why.
Regarding the second method, you may need to check the Fuel_auth::check_valid_ip method to see what the $check_address variable is set to which is what will be used to validate against.
So with that in place it all works - of course.