backwpup icon indicating copy to clipboard operation
backwpup copied to clipboard

Default backup schedule causes server's high resource consumption

Open g-taniguchi opened this issue 6 years ago • 0 comments

I have a request for BackWpUp plugin. BackWpUp's new backup job sets timing to 3 AM on everyday as a default. So our hosting servers have high resource consumption on the time and it often causes backup process (actually wp-cron.php process) shutdown.

If you don't mind, would you set random(e.g. 1 AM to 6 AM) backup schedule to the plugin or set null to pulldown? I can't figure out other good solutions sorry. But we are happy to be dispersed backup time.

For example,

+++ wp-content/plugins/backwpup/inc/class-option.php    2019-07-10 13:19:08.000000000 +0900
@@ -195,6 +195,7 @@
        public static function defaults_job( $key = '' ) {

                $key = sanitize_key( trim( $key ) );
+               $rnd = mt_rand(1,6);

                //set defaults
                $default['type'] = array( 'DBDUMP', 'FILE', 'WPPLUGIN' );
@@ -204,7 +205,7 @@
                $default['logfile'] = '';
                $default['lastbackupdownloadurl'] = '';
                $default['cronselect'] = 'basic';
-               $default['cron'] = '0 3 * * *';
+               $default['cron'] = "0 $rnd * * *";
                $default['mailaddresslog'] = sanitize_email( get_bloginfo( 'admin_email' ) );
                $default['mailaddresssenderlog'] = 'BackWPup ' . get_bloginfo( 'name' ) . ' <' . sanitize_email( get_bloginfo( 'admin_email' ) ) . '>';
                $default['mailerroronly'] = true;```

g-taniguchi avatar Jul 10 '19 07:07 g-taniguchi