You can remove old backups to limit the space your backups consume on your local hard drive. It's important to note,
that only local backups will be cleaned up. So whatever kind of Sync
you are using. Cleanup
won't touch your remote files.
If you want to remove your synced backups as well, currently the only way to do this is to use the
Rsync sync with it's delete
option.
Table 8.1. Supported types of cleanups:
Type | Description |
---|---|
Capacity | Define the size your backups should occupy. If your backups start to exceed this value PHPBU will start to delete backups, starting with the oldest ones. |
Outdated | Remove backups older than a configured time-value. For example "2W" to delete all backup older than two weeks. |
Quantity | Keep only a configured amount of backups. |
Remove oldest backups if all created backups exceed the configured limit.
Table 8.2. Capacity-Options
Name | Value | Required | Default | Description |
---|---|---|---|---|
size | string | yes | - | Space your backups are allowed to occupy. e.g. 500M for 500 Megabytes or 1G for one Gigabyte. |
deleteTarget | boolean | no | false | If you don't want to keep any backups locally, just specify a size of "0B", set this to "true" and even the current backup will be deleted. |
Example 8.1: capacity XML example
<!-- cleanup capacity: keep 250 Megabytes of backups --> <cleanup type="capacity"> <option name="size" value="250M"/> <option name="deleteTarget" value="false"/> </cleanup>
Example 8.2: capacity JSON example
{ "type": "capacity", "options": { "size": "250M", "deleteTarget": "false" } }
Remove backups that are older than a configured value.
Table 8.3. Outdated-Options
Name | Value | Required | Default | Description |
---|---|---|---|---|
older | string | yes | - | Time to keep backups. e.g. 1m for one month or 20d for twenty days. |
Example 8.3: outdated XML example
<!-- cleanup outdated: keep backups for 2 weeks --> <cleanup type="outdated"> <option name="older" value="2W"/> </cleanup>
Keep only a configured amount of backups.
Table 8.4. Quantity-Options
Name | Value | Required | Default | Description |
---|---|---|---|---|
amount | string | yes | - | The amount of backups to keep. |
Example 8.5: quantity XML example
<!-- cleanup quantity: keep the last 20 backups --> <cleanup type="quantity"> <option name="amount" value="20"/> </cleanup>