Background
By default – Prime Mover 2.0.0+ automatic backup PRO feature supports the following backup schedules:
- Once daily
- Twice weekly
- Once weekly
- Twice monthly
- Once monthly
These default schedules are designed to be sufficient for most auto-backup implementations. However if for some reason you need a custom backup schedule – this short tutorial illustrates the solution.
Formulate custom backup schedule parameters
The first step is to formulate your custom backup schedule parameters via a constant. This needs to be added to wp-config.php
. For example – the code below will add two new custom backup schedules of once in 3 months and once in 6 months.
define('PRIME_MOVER_AUTOBACKUP_CUSTOM_SCHEDULES', json_encode ( [ 'prime_mover_every_three_months' => [ 'interval' => 7776000, 'display' => 'Once in 3 months' ], 'prime_mover_every_six_months' => [ 'interval' => 15552000, 'display' => 'Once in 6 months' ] ] ) );
Some notes of the above example:
PRIME_MOVER_AUTOBACKUP_CUSTOM_SCHEDULES
is the constant name. Please do not change this.- Only change these lines to add your own custom backup schedules:
'prime_mover_every_three_months' => [ 'interval' => 7776000, 'display' => 'Once in 3 months' ], 'prime_mover_every_six_months' => [ 'interval' => 15552000, 'display' => 'Once in 6 months' ]
WHERE:
prime_mover_every_three_months
= the identifier of your new custom backup schedule. Make this name user-friendly for easy identification. It is recommended to use the naming convention:prime_mover_every_{YOUR_SCHEDULE_SLUG}
interval
– your backup schedule in seconds. For example in 3 months, the total number of seconds is 7776000. It’s because approximately in one month – the total number of seconds is 2592000. Multiply this by 3 (for 3 months) will be the total seconds in months.display
– This is the user-friendly name that will be displayed in your Prime Mover automatic backup custom schedule settings. It is recommended to use English name descriptions for maximum compatibility. This is not translatable for now.
Case example: Add a new custom backup schedule – “Once in three weeks”
Let’s have an example for clarification purposes. Supposing you want to run an automatic backup once in 3 weeks. However, this schedule is not included in the Prime Mover default backup schedules. This custom schedule needs to be added.
First, let’s compute the total number of seconds in 3 weeks. In addition – it is a known fact that one day has 86400 seconds. Therefore the total number of seconds in 3 weeks (which has 21 days on it) will be:
Total number of seconds = 21 x 86400 = 1814400
Next, we formulate the custom backup schedule parameters and define all needed parameter values:
define('PRIME_MOVER_AUTOBACKUP_CUSTOM_SCHEDULES', json_encode ( [ 'prime_mover_every_three_weeks' => [ 'interval' => 1814400, 'display' => 'Once in 3 weeks' ] ] ) );
It done! The only thing needed now is to add to wp-config.php. This is how it looks like if it’s added on wp-config.php
. In this example – it is added on the topmost part of the configuration file for visibility.
Verify if the settings appear in backup schedules
Finally – you need to log in as a network administrator and verify that your custom backup schedule appears in your Prime Mover backup schedule settings.
Go to Prime Mover PRO -> Toolbox -> Under “Backup schedule” – you should see your custom backup schedule and it’s ready to be used.
As you can see – the new custom backup schedule “Once in 3 weeks” has now been added. This implies that you have added this schedule correctly.
Important note about the custom backup schedule
Make sure this custom backup schedule is not removed from your wp-config.php
. Otherwise, your automatic backup won’t run anymore if this is not available.
Need help?
If you have issues adding a custom backup schedule and need technical assistance – please get in touch with our technical support. Thank you!