Default backup schedule causes server's high resource consumption

Open
#90 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
php
Domain
devops

Research direction

Start in inc/class-option.php, in defaults_job(), where the default cron value is set to 3 AM. Review how new backup jobs consume this value and determine the intended default scheduling behavior from the request. Done means newly created jobs no longer impose the same default time on every installation, with the resulting schedule covered by the project’s available checks.

Written by the indexing model from the issue text.

Description

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;```
Dominant language
PHP
Stars
95
Forks
46
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from wp-media/backwpup

All issues in wp-media/backwpup

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.