borgbackup/docs/man/borg-extract.1

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

162 lines
4.5 KiB
Groff
Raw Normal View History

2026-03-15 09:34:31 -04:00
.\" Man page generated from reStructuredText
.\" by the Docutils 0.22.4 manpage writer.
2017-02-05 08:22:06 -05: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
..
2026-06-16 08:17:43 -04:00
.TH "borg-extract" "1" "2026-06-16" "" "borg backup tool"
2026-03-15 09:34:31 -04:00
.SH Name
2025-12-23 12:00:09 -05:00
borg-extract \- Extracts archive contents.
2017-02-05 08:22:06 -05:00
.SH SYNOPSIS
.sp
2022-06-23 19:19:19 -04:00
borg [common options] extract [options] NAME [PATH...]
2017-02-05 08:22:06 -05:00
.SH DESCRIPTION
.sp
2025-12-23 12:00:09 -05:00
This command extracts the contents of an archive.
2017-02-05 08:22:06 -05:00
.sp
2025-12-23 12:00:09 -05:00
By default, the entire archive is extracted, but a subset of files and directories
can be selected by passing a list of \fBPATH\fP arguments. The default interpretation
for the paths to extract is \fIpp:\fP which is a literal path\-prefix match. If you want
to use e.g. a wildcard, you must select a different pattern style such as \fIsh:\fP or
\fIfm:\fP\&. See \fIborg_patterns\fP for more information.
.sp
The file selection can be further restricted by using the \fB\-\-exclude\fP option.
2022-02-19 12:48:13 -05:00
For more help on include/exclude patterns, see the \fIborg_patterns\fP command output.
2017-02-05 08:22:06 -05:00
.sp
By using \fB\-\-dry\-run\fP, you can do all extraction steps except actually writing the
2025-12-23 12:00:09 -05:00
output data: reading metadata and data chunks from the repository, checking the hash/HMAC,
decrypting, and decompressing.
2017-05-17 05:52:48 -04:00
.sp
\fB\-\-progress\fP can be slower than no progress display, since it makes one additional
pass over the archive metadata.
.sp
2026-03-15 09:34:31 -04:00
\fBNote:\fP
.INDENT 0.0
.INDENT 3.5
2022-09-10 10:03:27 -04:00
Currently, extract always writes into the current working directory (\(dq.\(dq),
so make sure you \fBcd\fP to the right place before calling \fBborg extract\fP\&.
2022-02-05 11:30:40 -05:00
.sp
When parent directories are not extracted (because of using file/directory selection
2025-12-23 12:00:09 -05:00
or any other reason), Borg cannot restore parent directories\(aq metadata, e.g., owner,
group, permissions, etc.
.UNINDENT
.UNINDENT
2017-02-05 08:22:06 -05:00
.SH OPTIONS
.sp
See \fIborg\-common(1)\fP for common options of Borg commands.
.SS arguments
.INDENT 0.0
.TP
2022-06-23 19:19:19 -04:00
.B NAME
specify the archive name
2017-02-05 08:22:06 -05:00
.TP
.B PATH
paths to extract; patterns are supported
.UNINDENT
2025-04-21 15:07:46 -04:00
.SS options
2017-02-05 08:22:06 -05:00
.INDENT 0.0
.TP
2022-06-23 19:19:19 -04:00
.B \-\-list
2025-12-23 12:00:09 -05:00
output a verbose list of items (files, dirs, ...)
2017-02-05 08:22:06 -05:00
.TP
2022-06-23 19:19:19 -04:00
.B \-n\fP,\fB \-\-dry\-run
2017-02-05 08:22:06 -05:00
do not actually change any files
.TP
2022-06-23 19:19:19 -04:00
.B \-\-numeric\-ids
2025-12-23 12:00:09 -05:00
only use numeric user and group identifiers
.TP
2022-06-23 19:19:19 -04:00
.B \-\-noflags
2020-04-12 13:55:57 -04:00
do not extract/set flags (e.g. NODUMP, IMMUTABLE)
.TP
2022-06-23 19:19:19 -04:00
.B \-\-noacls
2021-05-11 16:33:28 -04:00
do not extract/set ACLs
.TP
2022-06-23 19:19:19 -04:00
.B \-\-noxattrs
2021-05-11 16:33:28 -04:00
do not extract/set xattrs
.TP
2022-06-23 19:19:19 -04:00
.B \-\-stdout
write all extracted data to stdout
.TP
2022-06-23 19:19:19 -04:00
.B \-\-sparse
2025-12-23 12:00:09 -05:00
create holes in the output sparse file from all\-zero chunks
2023-06-11 17:10:23 -04:00
.TP
.B \-\-continue
2025-12-23 12:00:09 -05:00
continue a previously interrupted extraction of the same archive
.UNINDENT
2023-06-11 17:10:23 -04:00
.SS Include/Exclude options
.INDENT 0.0
.TP
2020-10-04 14:33:08 -04:00
.BI \-e \ PATTERN\fR,\fB \ \-\-exclude \ PATTERN
2017-02-05 08:22:06 -05:00
exclude paths matching PATTERN
.TP
.BI \-\-exclude\-from \ EXCLUDEFILE
read exclude patterns from EXCLUDEFILE, one per line
.TP
2017-03-26 19:58:19 -04:00
.BI \-\-pattern \ PATTERN
2022-02-05 11:30:40 -05:00
include/exclude paths matching PATTERN
2017-03-26 19:58:19 -04:00
.TP
.BI \-\-patterns\-from \ PATTERNFILE
2022-02-05 11:30:40 -05:00
read include/exclude patterns from PATTERNFILE, one per line
2017-03-26 19:58:19 -04:00
.TP
2017-02-05 08:22:06 -05:00
.BI \-\-strip\-components \ NUMBER
Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped.
2017-02-05 08:22:06 -05:00
.UNINDENT
.SH EXAMPLES
.INDENT 0.0
.INDENT 3.5
.sp
2025-04-21 15:07:46 -04:00
.EX
2017-02-05 08:22:06 -05:00
# Extract entire archive
2022-06-23 19:19:19 -04:00
$ borg extract my\-files
2017-02-05 08:22:06 -05:00
# Extract entire archive and list files while processing
2022-06-23 19:19:19 -04:00
$ borg extract \-\-list my\-files
2017-02-05 08:22:06 -05:00
# Verify whether an archive could be successfully extracted, but do not write files to disk
2022-06-23 19:19:19 -04:00
$ borg extract \-\-dry\-run my\-files
2017-02-05 08:22:06 -05:00
2022-09-10 10:03:27 -04:00
# Extract the \(dqsrc\(dq directory
2022-06-23 19:19:19 -04:00
$ borg extract my\-files home/USERNAME/src
2017-02-05 08:22:06 -05:00
2022-09-10 10:03:27 -04:00
# Extract the \(dqsrc\(dq directory but exclude object files
2022-06-23 19:19:19 -04:00
$ borg extract my\-files home/USERNAME/src \-\-exclude \(aq*.o\(aq
2017-02-05 08:22:06 -05:00
2025-12-23 12:00:09 -05:00
# Extract only the C files
$ borg extract my\-files \(aqsh:home/USERNAME/src/*.c\(aq
2017-02-05 08:22:06 -05:00
# Restore a raw device (must not be active/in use/mounted at that time)
2022-06-23 19:19:19 -04:00
$ borg extract \-\-stdout my\-sdx | dd of=/dev/sdx bs=10M
2025-04-21 15:07:46 -04:00
.EE
2017-02-05 08:22:06 -05:00
.UNINDENT
.UNINDENT
.SH SEE ALSO
.sp
\fIborg\-common(1)\fP, \fIborg\-mount(1)\fP
2026-03-15 09:34:31 -04:00
.SH Author
2017-02-05 08:22:06 -05:00
The Borg Collective
2026-03-15 09:34:31 -04:00
.\" End of generated man page.