Cron methods for backup module

edited July 2015 in Share
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

  • edited 12:10AM
    That first scenario is strange in that those $_SERVER variables aren't set. You are right that they should be set if running it via CLI because those variables are set in the index.php. The only change I can think of between 1.2.1 and In 1.3 was to line 23 in the index.php file from:
    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.
  • edited 12:10AM
    I've finally got round to debugging this, the issue with method 2 was that the remote IP wasn't what I expected it to be - my guess is it is the firewall IP

    So with that in place it all works - of course.
Sign In or Register to comment.