Update docs on deleting multiple archives

This commit is contained in:
Saurav Sachidanand 2018-05-26 21:13:43 +05:30
parent 3931340baa
commit b3c1104760
2 changed files with 21 additions and 1 deletions

View File

@ -7,6 +7,15 @@ Examples
# delete a single backup archive:
$ borg delete /path/to/repo::Monday
# delete all archives whose names begin with the machine's hostname followed by "-"
$ borg delete --prefix '{hostname}-' /path/to/repo
# delete all archives whose names contain "-2012-"
$ borg delete --glob-archives '*-2012-*' /path/to/repo
# see what would be deleted if delete was run without --dry-run
$ borg delete -v --dry-run -a '*-May-*' /path/to/repo
# delete the whole repository and the related local cache:
$ borg delete /path/to/repo
You requested to completely DELETE the repository *including* all archives it contains:

View File

@ -3171,12 +3171,23 @@ class Archiver:
delete_epilog = process_epilog("""
This command deletes an archive from the repository or the complete repository.
Disk space is reclaimed accordingly. If you delete the complete repository, the
local cache for it (if any) is also deleted.
local cache for it (if any) is also deleted. Alternatively, you can delete just
the local cache with the ``--cache-only`` option.
When using ``--stats``, you will get some statistics about how much data was
deleted - the "Deleted data" deduplicated size there is most interesting as
that is how much your repository will shrink.
Please note that the "All archives" stats refer to the state after deletion.
You can delete multiple archives by specifying their common prefix, if they
have one, using the ``--prefix PREFIX`` option. You can also specify a shell
pattern to match multiple archives using the ``--glob-archives GLOB`` option
(for more info on these patterns, see ``borg help patterns``). Note that these
two options are mutually exclusive.
To avoid accidentally deleting archives, especially when using glob patterns,
it might be helpful to use the ``--dry-run`` to test out the command without
actually making any changes to the repository.
""")
subparser = subparsers.add_parser('delete', parents=[common_parser], add_help=False,
description=self.do_delete.__doc__,