borg/docs/man/borg-import-tar.1

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

222 lines
5.8 KiB
Groff
Raw Normal View History

2022-01-23 14:53:42 +00:00
.\" Man page generated from reStructuredText.
.
.
.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
..
2024-02-20 16:12:43 +00:00
.TH "BORG-IMPORT-TAR" 1 "2024-02-20" "" "borg backup tool"
2022-06-23 23:19:19 +00:00
.SH NAME
borg-import-tar \- Create a backup archive from a tarball
2022-01-23 14:53:42 +00:00
.SH SYNOPSIS
.sp
2022-06-23 23:19:19 +00:00
borg [common options] import\-tar [options] NAME TARFILE
2022-01-23 14:53:42 +00:00
.SH DESCRIPTION
.sp
This command creates a backup archive from a tarball.
.sp
When giving \(aq\-\(aq as path, Borg will read a tar stream from standard input.
.sp
By default (\-\-tar\-filter=auto) Borg will detect whether the file is compressed
based on its file extension and pipe the file through an appropriate filter:
.INDENT 0.0
.IP \(bu 2
\&.tar.gz or .tgz: gzip \-d
.IP \(bu 2
\&.tar.bz2 or .tbz: bzip2 \-d
.IP \(bu 2
\&.tar.xz or .txz: xz \-d
.IP \(bu 2
2022-11-26 21:23:46 +00:00
\&.tar.zstd or .tar.zst: zstd \-d
2022-01-23 14:53:42 +00:00
.IP \(bu 2
\&.tar.lz4: lz4 \-d
.UNINDENT
.sp
Alternatively, a \-\-tar\-filter program may be explicitly specified. It should
read compressed data from stdin and output an uncompressed tar stream on
stdout.
.sp
Most documentation of borg create applies. Note that this command does not
support excluding files.
.sp
A \fB\-\-sparse\fP option (as found in borg create) is not supported.
.sp
2022-04-14 19:13:46 +00:00
About tar formats and metadata conservation or loss, please see \fBborg export\-tar\fP\&.
.sp
import\-tar reads these tar formats:
.INDENT 0.0
.IP \(bu 2
BORG: borg specific (PAX\-based)
.IP \(bu 2
PAX: POSIX.1\-2001
.IP \(bu 2
GNU: GNU tar
.IP \(bu 2
POSIX.1\-1988 (ustar)
.IP \(bu 2
UNIX V7 tar
.IP \(bu 2
SunOS tar with extended attributes
.UNINDENT
2023-06-11 21:10:23 +00:00
.sp
To import multiple tarballs into a single archive, they can be simply
concatenated (e.g. using \(dqcat\(dq) into a single file, and imported with an
\fB\-\-ignore\-zeros\fP option to skip through the stop markers between them.
2022-01-23 14:53:42 +00:00
.SH OPTIONS
.sp
See \fIborg\-common(1)\fP for common options of Borg commands.
.SS arguments
.INDENT 0.0
.TP
2022-06-23 23:19:19 +00:00
.B NAME
specify the archive name
2022-01-23 14:53:42 +00:00
.TP
.B TARFILE
2022-09-10 14:03:27 +00:00
input tar file. \(dq\-\(dq to read from stdin instead.
2022-01-23 14:53:42 +00:00
.UNINDENT
2022-11-26 21:23:46 +00:00
.SS options
2022-01-23 14:53:42 +00:00
.INDENT 0.0
.TP
2022-06-23 23:19:19 +00:00
.B \-\-tar\-filter
2022-01-23 14:53:42 +00:00
filter program to pipe data through
.TP
2022-06-23 23:19:19 +00:00
.B \-s\fP,\fB \-\-stats
2022-01-23 14:53:42 +00:00
print statistics for the created archive
.TP
2022-06-23 23:19:19 +00:00
.B \-\-list
2022-01-23 14:53:42 +00:00
output verbose list of items (files, dirs, ...)
.TP
.BI \-\-filter \ STATUSCHARS
only display items with the given status characters
.TP
2022-06-23 23:19:19 +00:00
.B \-\-json
2022-01-23 14:53:42 +00:00
output stats as JSON (implies \-\-stats)
2023-06-11 21:10:23 +00:00
.TP
.B \-\-ignore\-zeros
ignore zero\-filled blocks in the input tarball
2022-01-23 14:53:42 +00:00
.UNINDENT
.SS Archive options
.INDENT 0.0
.TP
.BI \-\-comment \ COMMENT
add a comment text to the archive
.TP
.BI \-\-timestamp \ TIMESTAMP
2022-09-10 14:03:27 +00:00
manually specify the archive creation date/time (yyyy\-mm\-ddThh:mm:ss[(+|\-)HH:MM] format, (+|\-)HH:MM is the UTC offset, default: local time zone). Alternatively, give a reference file/directory.
2022-01-23 14:53:42 +00:00
.TP
.BI \-c \ SECONDS\fR,\fB \ \-\-checkpoint\-interval \ SECONDS
write checkpoint every SECONDS seconds (Default: 1800)
.TP
2023-02-26 20:30:54 +00:00
.BI \-\-checkpoint\-volume \ BYTES
write checkpoint every BYTES bytes (Default: 0, meaning no volume based checkpointing)
.TP
2022-01-23 14:53:42 +00:00
.BI \-\-chunker\-params \ PARAMS
specify the chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE). default: buzhash,19,23,21,4095
.TP
.BI \-C \ COMPRESSION\fR,\fB \ \-\-compression \ COMPRESSION
2022-09-10 14:03:27 +00:00
select compression algorithm, see the output of the \(dqborg help compression\(dq command for details.
2022-01-23 14:53:42 +00:00
.UNINDENT
2022-04-14 19:13:46 +00:00
.SH EXAMPLES
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
# export as uncompressed tar
2022-06-23 23:19:19 +00:00
$ borg export\-tar Monday Monday.tar
2022-04-14 19:13:46 +00:00
# import an uncompressed tar
2022-06-23 23:19:19 +00:00
$ borg import\-tar Monday Monday.tar
2022-04-14 19:13:46 +00:00
# exclude some file types, compress using gzip
2022-06-23 23:19:19 +00:00
$ borg export\-tar Monday Monday.tar.gz \-\-exclude \(aq*.so\(aq
2022-04-14 19:13:46 +00:00
# use higher compression level with gzip
2022-09-10 14:03:27 +00:00
$ borg export\-tar \-\-tar\-filter=\(dqgzip \-9\(dq Monday Monday.tar.gz
2022-04-14 19:13:46 +00:00
# copy an archive from repoA to repoB
2022-06-23 23:19:19 +00:00
$ borg \-r repoA export\-tar \-\-tar\-format=BORG archive \- | borg \-r repoB import\-tar archive \-
2022-04-14 19:13:46 +00:00
# export a tar, but instead of storing it on disk, upload it to remote site using curl
2022-06-23 23:19:19 +00:00
$ borg export\-tar Monday \- | curl \-\-data\-binary @\- https://somewhere/to/POST
2022-04-14 19:13:46 +00:00
2022-09-10 14:03:27 +00:00
# remote extraction via \(dqtarpipe\(dq
$ borg export\-tar Monday \- | ssh somewhere \(dqcd extracted; tar x\(dq
2022-04-14 19:13:46 +00:00
.ft P
.fi
.UNINDENT
.UNINDENT
.SS Archives transfer script
.sp
Outputs a script that copies all archives from repo1 to repo2:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
2023-01-02 22:51:22 +00:00
for A T in \(gaborg list \-\-format=\(aq{archive} {time:%Y\-%m\-%dT%H:%M:%S}{NL}\(aq\(ga
2022-04-14 19:13:46 +00:00
do
2022-09-10 14:03:27 +00:00
echo \(dqborg \-r repo1 export\-tar \-\-tar\-format=BORG $A \- | borg \-r repo2 import\-tar \-\-timestamp=$T $A \-\(dq
2022-04-14 19:13:46 +00:00
done
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Kept:
.INDENT 0.0
.IP \(bu 2
archive name, archive timestamp
.IP \(bu 2
archive contents (all items with metadata and data)
.UNINDENT
.sp
Lost:
.INDENT 0.0
.IP \(bu 2
some archive metadata (like the original commandline, execution time, etc.)
.UNINDENT
.sp
Please note:
.INDENT 0.0
.IP \(bu 2
all data goes over that pipe, again and again for every archive
.IP \(bu 2
the pipe is dumb, there is no data or transfer time reduction there due to deduplication
.IP \(bu 2
maybe add compression
.IP \(bu 2
pipe over ssh for remote transfer
.IP \(bu 2
no special sparse file support
.UNINDENT
2022-01-23 14:53:42 +00:00
.SH SEE ALSO
.sp
\fIborg\-common(1)\fP
.SH AUTHOR
The Borg Collective
.\" Generated by docutils manpage writer.
.