With cloneworx Backup Pro backups are kept in tiers according to their age: all of the most recent ones, and of the older ones one per day, week or month. That way the retention reaches far back with few backups.
This feature belongs to cloneworx Backup Pro: Installation · Order
An example
The diagram shows an example plan with the rhythm Every 5 minutes and one target. The bars at the top are the four tiers, the dots on the time axis are the backups that are kept. Each tier counts on its own; a backup stays as soon as one tier keeps it. If another tier already keeps it, it counts only once: that is why the time axis shows 3 weekly instead of 4. In total 46 backups are kept, and the oldest is about one year old. With Max. backups 46, the same backups would reach back just under four hours with Every 5 minutes.
The four tiers
| Tier | What stays | Tooltip in the form |
|---|---|---|
| Every run (hours) | every run of the last hours | This many hours every run of the plan stays. With “every 5 minutes” and 2 hours that is 24 backups. |
| Daily (days) | the first run per calendar day | This many daily backups stay: per calendar day the first run; the current day counts. A run that “Every run” already keeps is not counted twice. |
| Weekly (weeks) | the first run per week | This many weekly backups stay: per week the first run; the current week counts. |
| Monthly (months) | the first run per calendar month | This many monthly backups stay: per calendar month the first run; the current month counts. |
Days, weeks and months count in the time zone of the website; a week starts on Monday. 0 switches a tier off.
How to set it up
Open the plan in the Extended view with More … and Edit. Next to Retention, click Edit and enter the values:
- Max. backups stays at 0 as long as a tier is set.
- Every run sets for how many hours every run of the plan is kept.
- Daily keeps the first run per calendar day, for this many days.
- Weekly keeps the first run per week, for this many weeks.
- Monthly keeps the first run per calendar month, for this many months.
- Each tier keeps one backup per span, as far back as given; 0 switches the tier off. Older backups fall away.
- The preview shows for each target how many backups are kept with these values, for example “SFTP 1: all 24 runs from 2 hours, 7 daily, 3 weekly, 12 monthly: 46 backups”.
- Show as chart opens the dialog Retention with the chart for this target.
Click Save. The tiers take effect after the next valid backup of the plan.
What applies
- Number or tiers: if you set a tier, Max. backups jumps to 0. If you enter a number, all tiers jump to 0. If all five values are 0, the plugin does not save the plan: Enter a number from 1 to 99 under Max. backups.
- Per target: the tiers apply to each target separately. If a target receives only the first run of each week under its rule, there are no daily backups there: The 3-2-1 rule - the gold standard for backups.
- What is never deleted: the newest backup is always kept. The plugin never deletes locked backups automatically.
- Preview and chart: both calculate from the rhythm, the rule of the target and the tiers how many backups will be kept from now on, not from the backups already at the target. The chart in the plugin shows your values on a time axis with sections for hours, days, weeks, months and years and therefore looks somewhat different from the diagram above.
- After the purchase: a plan with a number behaves exactly as before after cloneworx Backup Pro is installed, until you edit and save the retention.
- Without cloneworx Backup Pro or without a valid licence: a plan with tiers stays switched on, but every run ends with an error and backs up nothing, because without cloneworx Backup Pro its backups would never be deleted. The plan runs again as soon as you save it in the form with a number under Max. backups. More about this: Backup plans: tile and form.
See also
- Define how many backups are kept
- Backup plans: tile and form
- Backups every 5 to 30 minutes
- What cloneworx Backup Pro can do
On the command line
WP-CLI not set up yet? How to install WP-CLI.
wp pro-plan sets the tiers with --age: run in hours, daily, weekly and monthly; tiers not specified are 0, an empty value switches all of them off. --retention is then 0. wp pro-plan list shows the tiers of every plan.
# Set the retention by age wp pro-plan edit "Datenbank" --age=run:2,daily:7,weekly:4,monthly:12 # Show the tiers of all plans wp pro-plan list # Back to a fixed number wp pro-plan edit "Datenbank" --age="" --retention=7