• Resolved diondkb

    (@diondkb)


    Hi,

    I need to run my backup script from a webservice like easycron. How do I test if my script below will continue to backup after the cron service has disconnected(ie complete the backup on the server). Also, do I remove the updraft entry from the wp_cron system?

    <?php
    
    //ignore_user_abort(true);
    //define('UPDRAFTPLUS_CONSOLELOG', true);
    //define('DOING_CRON', true);
    require_once('wp-load.php');
    echo 'Starting backup...'
    do_action('updraft_backup_all');
    
    ?>

    Thanks,
    Dion

    https://ww.wp.xz.cn/plugins/updraftplus/

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

    (@dnutbourne)

    Hi Dion,

    Once triggered, the backup will run independently of the cron service, and it should not be timed out.

    It is best to set scheduled backups to ‘Manual’. This will remove the scheduled tasks.

    We have a guide to running UPdraftPlus from the shell/cron available here:
    https://updraftplus.com/faqs/can-i-run-backups-from-the-shell/

    Thread Starter diondkb

    (@diondkb)

    Hi,

    Can I check the script by running the php file from the browser? I have run it already but nothing seems to happen. There is no new zip file in my dropbox. Or is there another way to check the script.

    Plugin Contributor DNutbourne

    (@dnutbourne)

    Hi,

    Yes, you can run the script from the browser. Though nothing will be shown on the page until the backup is complete. I would recommend testing from the shell instead.

    You will need to un-comment the UPDRAFTPLUS_CONSOLELOG ad DOING_CRON lines and make sure all lines end with ‘;’

    Corrected script below:

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

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

The topic ‘testing the updraftplus backup script’ is closed to new replies.