2017-02-05 13:22:06 +00:00
. \" Man page generated from reStructuredText.
.
2022-04-14 19:13:46 +00:00
.TH BORG-DELETE 1 "2022-04-14" "" "borg backup tool"
.SH NAME
borg-delete \- Delete an existing repository or archives
2017-02-05 13:22:06 +00:00
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\ $1 \\ n[an-margin]
level \\ n[rst2man-indent-level]
level margin: \\ n[rst2man-indent\\ n[rst2man-indent-level]]
-
\\ n[rst2man-indent0]
\\ n[rst2man-indent1]
\\ n[rst2man-indent2]
. .
.de1 INDENT
. \" .rstReportMargin pre:
. RS \\ $1
. nr rst2man-indent\\n[rst2man-indent-level] \\ n[an-margin]
. nr rst2man-indent-level +1
. \" .rstReportMargin post:
. .
.de UNINDENT
. RE
. \" indent \\n[an-margin]
. \" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
. \" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\ n[rst2man-indent\\n[rst2man-indent-level]]u
. .
.SH SYNOPSIS
.sp
2019-09-06 22:36:10 +00:00
borg [common options] delete [options] [REPOSITORY_OR_ARCHIVE] [ARCHIVE...]
2017-02-05 13:22:06 +00:00
.SH DESCRIPTION
.sp
This command deletes an archive from the repository or the complete repository.
2018-07-12 20:00:19 +00:00
.sp
Important: When deleting archives, repository disk space is \fB not\fP freed until
you run \fB borg compact\fP \& .
.sp
2020-04-12 17:55:57 +00:00
When you delete a complete repository, the security info and local cache for it
(if any) are also deleted. Alternatively, you can delete just the local cache
with the \fB \- \- cache\- only\fP option, or keep the security info with the
\fB \- \- keep\- security\- info\fP option.
2017-11-25 13:38:04 +00:00
.sp
2021-02-06 00:32:54 +00:00
When in doubt, use \fB \- \- dry\- run \- \- list\fP to see what would be deleted.
.sp
2017-11-25 13:38:04 +00:00
When using \fB \- \- stats\fP , 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.
2018-07-12 20:00:19 +00:00
.sp
You can delete multiple archives by specifying their common prefix, if they
have one, using the \fB \- \- prefix PREFIX\fP option. You can also specify a shell
pattern to match multiple archives using the \fB \- \- glob\- archives GLOB\fP option
2022-02-19 17:48:13 +00:00
(for more info on these patterns, see \fI borg_patterns\fP ). Note that these
2018-07-12 20:00:19 +00:00
two options are mutually exclusive.
.sp
To avoid accidentally deleting archives, especially when using glob patterns,
it might be helpful to use the \fB \- \- dry\- run\fP to test out the command without
actually making any changes to the repository.
2017-02-05 13:22:06 +00:00
.SH OPTIONS
.sp
See \fI borg\- common(1)\fP for common options of Borg commands.
.SS arguments
.INDENT 0 .0
.TP
2019-09-06 22:36:10 +00:00
.B REPOSITORY_OR_ARCHIVE
repository or archive to delete
2017-11-25 13:38:04 +00:00
.TP
.B ARCHIVE
archives to delete
2017-02-05 13:22:06 +00:00
.UNINDENT
.SS optional arguments
.INDENT 0 .0
.TP
2022-04-14 19:13:46 +00:00
.B \- n\fP,\fB \- \- dry\-run
2018-07-12 20:00:19 +00:00
do not change repository
.TP
2022-04-14 19:13:46 +00:00
.B \- \- list
2021-02-06 00:32:54 +00:00
output verbose list of archives
.TP
2022-04-14 19:13:46 +00:00
.B \- s\fP,\fB \- \- stats
2017-02-05 13:22:06 +00:00
print statistics for the deleted archive
.TP
2022-04-14 19:13:46 +00:00
.B \- \- cache\-only
2017-02-05 13:22:06 +00:00
delete only the local cache for the given repository
.TP
2022-04-14 19:13:46 +00:00
.B \- \- force
2017-11-25 13:38:04 +00:00
force deletion of corrupted archives, use \fB \- \- force \- \- force\fP in case \fB \- \- force\fP does not work.
2017-02-05 13:22:06 +00:00
.TP
2022-04-14 19:13:46 +00:00
.B \- \- keep\-security\-info
2020-04-12 17:55:57 +00:00
keep the local security info when deleting a repository
.TP
2022-04-14 19:13:46 +00:00
.B \- \- save\-space
2017-02-05 13:22:06 +00:00
work slower, but using less space
.UNINDENT
2017-11-25 13:38:04 +00:00
.SS Archive filters
2017-02-05 13:22:06 +00:00
.INDENT 0 .0
.TP
2020-10-04 18:33:08 +00:00
.BI \- P \ PREFIX\fR,\fB \ \- \- prefix \ PREFIX
2017-06-18 10:13:28 +00:00
only consider archive names starting with this prefix.
.TP
2020-10-04 18:33:08 +00:00
.BI \- a \ GLOB\fR,\fB \ \- \- glob\-archives \ GLOB
2017-06-18 10:13:28 +00:00
only consider archive names matching the glob. sh: rules apply, see "borg help patterns". \fB \- \- prefix\fP and \fB \- \- glob\- archives\fP are mutually exclusive.
2017-02-05 13:22:06 +00:00
.TP
2017-11-25 13:38:04 +00:00
.BI \- \- sort\-by \ KEYS
2017-02-05 13:22:06 +00:00
Comma\- separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp
.TP
.BI \- \- first \ N
consider first N archives after other filters were applied
.TP
.BI \- \- last \ N
consider last N archives after other filters were applied
.UNINDENT
.SH EXAMPLES
.INDENT 0 .0
.INDENT 3 .5
.sp
.nf
.ft C
# delete a single backup archive:
$ borg delete /path/to/repo::Monday
2018-07-12 20:00:19 +00:00
# actually free disk space:
$ borg compact /path/to/repo
# delete all archives whose names begin with the machine\(aq s hostname followed by "\- "
$ borg delete \- \- prefix \(aq {hostname}\- \(aq /path/to/repo
# delete all archives whose names contain "\- 2012\- "
$ borg delete \- \- glob\- archives \(aq *\- 2012\- *\(aq /path/to/repo
# see what would be deleted if delete was run without \- \- dry\- run
2021-02-06 00:32:54 +00:00
$ borg delete \- \- list \- \- dry\- run \- a \(aq *\- May\- *\(aq /path/to/repo
2017-02-05 13:22:06 +00:00
# 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:
repo Mon, 2016\- 02\- 15 19:26:54
root\- 2016\- 02\- 15 Mon, 2016\- 02\- 15 19:36:29
newname Mon, 2016\- 02\- 15 19:50:19
Type \(aq YES\(aq if you understand this and want to continue: YES
.ft P
.fi
.UNINDENT
.UNINDENT
.SH SEE ALSO
.sp
2018-07-12 20:00:19 +00:00
\fI borg\- common(1)\fP , \fI borg\- compact(1)\fP
2017-02-05 13:22:06 +00:00
.SH AUTHOR
The Borg Collective
. \" Generated by docutils manpage writer.
.