Max. backups sets, per backup plan, how many valid backups are kept at a target. The plugin deletes older ones on its own so that the target does not fill up.
You do not have to set anything here
This setting is optional. By default, 7 valid backups are kept per plan and target; the plugin deletes older ones on its own. You can adjust the number, but you do not have to for your website to get its backup.
What you need
- the Extended view. The switch is at the bottom left of the page. Only this view shows the group Retention with the field Max. backups.
Step 1: Open the plan
Open the Backup page. In the Backup plans tile, choose More … at the plan, then Edit.
Step 2: Set the number
- Targets and rotation are the targets of the plan.
- What is backed up is the content of the plan.
- Retention contains Max. backups.
- Back up the database as a snapshot backs up all tables as of the same moment.
- Edit expands a group.
Next to Retention, click Edit. Max. backups accepts 1 to 99; the default is 7. Enter the number and click Save. The new number takes effect after the next valid backup of this plan.
How the plugin counts
- Per plan and per target. Each plan counts its own backups, at each target separately.
- Valid backups only. A backup is valid when it finished complete or with warnings. At a target it only counts if it is complete there. Failed and aborted backups do not count.
- Locked backups are not counted. The plugin never deletes them automatically.
- The newest valid backup is always kept.
- Backups started by hand count too. A backup from Back up now or Run now belongs to its plan.
The short version is in the form of the plan, at the term with the dotted underline, Max. backups:
- How many valid backups stay per target. When a new backup is complete and checked, the oldest beyond this number is deleted.
- The term with the dotted underline shows the tooltip when the mouse pointer is on it.
An example: Max. backups is set to 7, and seven valid backups of the plan are stored at the target. After the eighth, the plugin deletes the oldest. If one of the eight is locked, only seven count, and all of them are kept.
PRORetention by age
This feature belongs to cloneworx Backup Pro: Installation · Order
With cloneworx Backup Pro, the group Retention shows four tiers below Max. backups: Every run, Daily, Weekly and Monthly. Instead of a fixed number, all of the most recent backups are then kept, and of the older ones, one per day, week or month. That way the retention reaches far back with few backups.
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:
- Every run 2 hours: all backups of the last 2 hours, so 24 with Every 5 minutes.
- Daily 7: the first run per calendar day, for 7 days. The current day counts.
- Weekly 4: the first run per week, for 4 weeks.
- Monthly 12: the first run per calendar month, for 12 months.
Each tier counts on its own; a backup is kept 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. The chart in the plugin (Show as chart) calculates with the values of your plan and therefore looks somewhat different.
How to set the tiers: next to Retention, click Edit and enter the values; Max. backups jumps to 0. The preview below shows, per target, how many backups are kept. Everything about the fields is in Backup plans: tile and form, more about the feature in Retention by age.
When deletion happens
The plugin deletes on its own, after every valid backup: for the plan of that backup and only at the targets where the new backup has arrived. The oldest is deleted only when the new backup is complete and checked at the target.
If something is deleted in the process, the main tile shows the line Deleting outdated backups. Afterwards the page reports the result:
- One old backup deleted. If there are several, the message shows the number.
- The plugin never deletes because space is running low. If a backup no longer fits at a target, it skips that target and ends with warnings. If no target is left, it ends with Not enough free space.
- Backups of a deleted plan stay until you delete them by hand.
- The plugin never automatically deletes backups for which the Plan column of the list shows imported or reclaimed.
- With its last copy, a backup disappears from the list. Its log stays for as long as logs are kept.
Reading the “Targets and space” tile
The tile is in the Extended view on the Backup and Targets pages. When you open the page, it is collapsed. A click on the title line expands it.
- Hide details collapses the tile again.
- The name of the target.
- The number of valid backups stored at this target.
- The space they take up.
- The free space at the target. The plugin knows it for local folders; otherwise there is a dash.
- Per plan, the counted backups and Max. backups, for example “Daily backup 7 / 7”. manual stands for backups without a plan.
The number per plan follows the rules above, so locked backups are not counted. The numbers of the plans together can therefore be smaller than the number of backups at the target. If the plan no longer exists, a dash follows the slash. A dash also follows imported and reclaimed: under these words the tile counts the backups for which the Plan column shows the same word.
Backups without a plan
A backup without a plan is only made on the command line. Such backups form the group manual with its own number. You find it in the Extended view on the Settings page, in the Retention tile.
- Max. backups without a plan accepts 1 to 99; the default is 7. The value is saved as soon as you leave the field.
If something does not work
| Message | What you can do |
|---|---|
| This value is out of range. | Enter a number from 1 to 99. Without cloneworx Backup Pro an empty field counts as an error. |
| Enter a number from 1 to 99 under Max. backups. | All five values are 0. Enter a number or set a tier. |
| Deleting old backups failed. | The message is yellow and takes you to the log with Log. Check the target on the Targets page with Test connection. |
Good to know
- If a check finds a backup damaged at a target, it no longer counts there. The plugin never deletes it automatically: Check a backup.
- If the folder at the target belongs to another installation, the plugin deletes nothing there: The website has moved or is a copy.
- If you want to keep a particular backup, for example before a big update, lock it.
See also
- Protect a backup from deletion
- Delete a backup
- Backup plans: tile and form
- The “Backup” page
- Create and manage backups with WP-CLI
On the command line
WP-CLI not set up yet? How to install WP-CLI.
With WP-CLI you can see what the plugin would delete, and delete it right away without waiting for the next backup. You also set both numbers here.
# Show what would be deleted now wp cloneworx-backup retention list # Delete now what exceeds Max. backups wp cloneworx-backup retention run # Delete for one backup plan only wp cloneworx-backup retention run --plan=plan-1 # Set Max. backups of a backup plan wp cloneworx-backup plan edit "Daily backup" --retention=14 # Set Max. backups without a plan wp cloneworx-backup settings set manual_retention 10