How can I add any new scheduling interval to UpdraftPlus?

If the built-in scheduling options (every 4 / 8 / 12 hours, daily, weekly, fortnightly, monthly) do not cover what you wanted, then you can easily add a new schedule to UpdraftPlus. To do so, create a directory wp-content/mu-plugins in your WordPress install (if it does not already exist), and create a file in it named ud-schedules.php with contents as below. Note that the example below is for adding an “hourly” schedule (i.e. every 3600 seconds); you should adapt it according to your needs.

<?php

add_filter('updraftplus_backup_intervals', 'local_updraftplus_backup_intervals');
function local_updraftplus_backup_intervals($ints) {
    $ints['hourly'] = 'Hourly';
    return $ints;
}

add_filter('cron_schedules', 'local_cron_schedules', 31);
function local_cron_schedules($schedules) {
    $schedules['hourly'] = array('interval' => 3600, 'display' => 'Once Hourly');
    return $schedules;
}

Posted in: Advanced usage

twitterlinkedingoogle_plusFacebook