• Resolved Jasnick

    (@jasnick)


    Good afternoon
    On the suggestion of my hosting company I recently added define('DISABLE_WP_CRON', true); to my wp-config file.
    Then I discovered my backups weren’t working. Read up on the situation and copied this code from UpdraftPlus

    define('UPDRAFTPLUS_CONSOLELOG', true);
    define('DOING_CRON', true);
    require_once('wp-load.php');
    do_action('updraft_backup_all');
    

    Do I place this in my wp-config file or in a new file?

    Then do I set up via cPanel/Cron Jobs a new job using the command
    /usr/local/bin/php /home/user/public_html/wp-cron.php

    and set a time etc and do this for all my sites? I imagine this setting would need to correspond to whatever time settings I have set in UpdraftPlus settings?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor DNutbourne

    (@dnutbourne)

    Hi,

    You will need to place the following code in a new .php file in your WordPress root directory:

    <?php
    
    define('UPDRAFTPLUS_CONSOLELOG', true);
    define('DOING_CRON', true);
    require_once('wp-load.php');
    do_action('updraft_backup_all');

    You will then need to set up a cronjob to call that file at the same time that the backup is scheduled, and several additional times at 5-10 minute intervals

    This will need to be set up for each site.

    Thread Starter Jasnick

    (@jasnick)

    Thanks DNutbourne
    I may have jumped the gun here. As you can tell I am not all that conversant with php. When I disabled the WP cronjob I replaced it with a Real cronjob. I have since realised that the UpdraftPlus backups are indeed working so I imagine that the Real cronjob is doing the same thing as the WP one.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Where to place cron job code’ is closed to new replies.