Jeffrey Winn's Blog

Assorted thoughts and information of nominal value

View on GitHub

For reasons that I, frankly, haven’t bothered to investigate, my updated WordPress blog (yes, the one you are reading now) has not been processing its routine tasks. This means, most importantly, that my backups are not.

So, we turn again to cron. After some research, I made this script, which is places in the ~/bin directory of the appropriate Nginx user (in my case, www-data) as wp-updraft-backup-cron.php:

<?php

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

…I know that this script should run just the specific plugin Updraft Backup, but it seems to unclog whatever else is waiting to process.

So, that’s good.

Note that, as this script is simple PHP, you must call it with PHP from cron:

15 */2 * * *    /usr/bin/php /usr/share/wordpress/bin/wp-updraft-backup-cron.php >/dev/null 2>&1

…Get back