zvault/docs/man/zvault-prune.1.md

109 lines
3.0 KiB
Markdown
Raw Normal View History

2017-04-05 14:02:16 +00:00
zvault-prune(1) -- Remove backups based on age
==============================================
## SYNOPSIS
2017-04-07 16:57:49 +00:00
`zvault prune [OPTIONS] <REPO>`
2017-04-05 14:02:16 +00:00
## DESCRIPTION
This subcommand removes backups in the repository `REPO` based on their age.
If a prefix is specified via `--prefix`, only backups which start with this
string are considered for removal.
The prune logic will preserve a certain number of backups for different time
periods and discard the rest. The available periods are `daily`, `weekly`,
`monthly` and `yearly`. For each of those periods, a number `N` can be specified
that defines that for each of the last `N` of these periods, a single backup
(the newest one in that period) will be kept.
For example, `--daily 3` will keep backups of the last 3 days, i.e. one backup
for today, yesterday and the day before yesterday (if a backup has been saved
today). If several backups have been saved on a single day, only the newest is
kept.
The different periods can also be combined to preserve backups using multiple
different time periods. Backups are only removed if they are not preserved by
any of the time periods.
For example, `--daily 3 --weekly 4 --monthly 3` will keep one backup for each of
the last 3 days, for each of the last 4 weeks and for each of the last 3 months.
As time progresses, the daily backups will be removed as new ones are created so
that only 3 of them are kept but each week one of them will be preserved as a
weekly backup and an old weekly backup will be removed unless that backup
happens to be the last backup of last month...
If one period is not set, no backups for that time period will be preserved.
This command will refuse to remove all backups if called without options.
Unless the option `--force` is set, this command only displays the backups that
would be removed but does not remove them.
This command renders certain chunks unused, but reclaiming their space is a
complicated task as chunks are combined into bundles together with other chunks
which are potentially still used. Please use _zvault-vacuum(1)_ to reclaim
unused space.
**Important note: Although this command does not actually remove any data, the
data of the deleted backups becomes inaccessible and can not be restored.**
## OPTIONS
* `-p`, `--prefix <PREFIX>`:
2017-04-05 14:02:16 +00:00
Only consider backups starting with this prefix.
2017-04-05 14:02:16 +00:00
* `-d`, `--daily <NUM>`:
2017-04-05 14:02:16 +00:00
Keep the newest backup for each of the last `NUM` days.
2017-04-05 14:02:16 +00:00
* `-w`, `--weekly <NUM>`:
2017-04-05 14:02:16 +00:00
Keep the newest backup for each of the last `NUM` weeks.
2017-04-05 14:02:16 +00:00
* `-m`, `--monthly <NUM>`:
2017-04-05 14:02:16 +00:00
Keep the newest backup for each of the last `NUM` months.
2017-04-05 14:02:16 +00:00
* `-y`, `--yearly <NUM>`:
2017-04-05 14:02:16 +00:00
Keep the newest backup for each of the last `NUM` years.
2017-04-05 14:02:16 +00:00
* `-f`, `--force`:
2017-04-05 14:02:16 +00:00
Actually remove backups instead of displaying what would be removed.
2017-04-05 14:02:16 +00:00
* `-q`, `--quiet`:
2017-04-05 14:02:16 +00:00
Print less information
* `-v`, `--verbose`:
Print more information
* `-h`, `--help`:
Prints help information
* `-V`, `--version`:
Prints version information
2017-04-05 14:02:16 +00:00
## COPYRIGHT
Copyright (C) 2017 Dennis Schwerdel
This software is licensed under GPL-3 or newer (see LICENSE.md)