wp-media / backwpup

BackWPup - WordPress Backup Plugin
https://backwpup.com
GNU General Public License v2.0
88 stars 37 forks source link

Default backup schedule causes server's high resource consumption #90

Open g-taniguchi opened 5 years ago

g-taniguchi commented 5 years ago

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;```