Managed backups failing on cronjob

Hi, I’m trying to run a Managed Backup on my cronjob, but when I go to check it, there is no new backup created, if I run manually it works fine, can you help me, please?

  • Ash
    • WordPress Hacker

    Hello Mike Anderson

    Would you please let me know how did you setup the cron job to take managed backup? Would you please send me the script you used for server cron?

    Also, we have sent your issue to our second level support team. Please note that, they deal with more complex issues, so there might be little delay. We appreciate your patience on this.

    Have a nice day!

    Cheers,

    Ash

  • Konstantinos Xenos
    • Rubber Duck Debugger

    Hi Mike Anderson ,

    I see that you have the WP_Cron disabled so I guess you’re talking about a server-side Cron job (crontab). The only thing needed is to invoke wp-cron.php so that should be really straight forward to set it up correctly, but I don’t know your system so unfortunately I can’t help you there, your hosting provider could set this up perfectly for you though since they know 100% how it will work for their systems.

    Apart from that my tests are resulting on a Error encountered: (0) cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes as well when WordPress is trying to make a callback to itself and that might as well be causing issues since a simple loopback fails as well.

    Could you inform your hosting provider about the cURL issue and tell us what they replied so we can continue looking of what might be going wrong?

    Regards,

    Konstantinos

  • Mike Anderson
    • Design Lord, Child of Thor

    Hi my hosting provider had this to say.

    ” Running the wget command via ssh vields no output or errors, so it’s tough to tell what might be causing the error looking at that command. I may recommend removing the following from your cron job: >/dev/null 2>&1 so it can send you an email about the cron job and if the cron itself is producing any errors they will be emailed to you. Also, it may be helpful to know what specific curl command is being run that is triggering the timeout. The command may need to be tweaked if it is interfering with a specific way the server is set up, however we will need to be able to test out the command in order to further troubleshoot this for you.”

    I have taken the suggested line out of the cron job. I will let you know what happens.

  • Konstantinos Xenos
    • Rubber Duck Debugger

    Hi Mike Anderson ,

    Thank you for the information, I’ll wait for the update when the cronjob error shows up.

    As for the cURL request, it’s a simple request to get your admin URL ( admin_url() function ) via WordPress itself ( that’s what we call a loopback ). It’s using the wp_remote_get() ( https://developer.wordpress.org/reference/functions/wp_remote_get/ ) function and it’s the same way as WordPress would call it’s cronjobs to check for updates etc.

    This is why I mentioned that WP couldn’t contact itself basically, sorry for the trouble I should’ve made it clearer on my previous post.

    You can test cURL yourself by installing Health Check ( https://wordpress.org/plugins/health-check/ ) plugin as well as it does a similar Loopback request, I’m pretty sure you’ll see the error again there.

    Regards,

    Konstantinos

  • Mike Anderson
    • Design Lord, Child of Thor

    Hi again, here is the latest from my server guys

    “Perhaps you could try changing the cron job command in the cPanel? See below for the new command that you can use:

    cd /home/dev1smb/public_html; /opt/cpanel/ea-php71/root/usr/bin/php -q wp-cron.php

    The new command uses php -q to execute the wp-cron.php file instead of using wget/curl. “

    I will let you know what happens

    Mike

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.