borg-import-tar.1 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. .\" Man page generated from reStructuredText.
  2. .
  3. .
  4. .nr rst2man-indent-level 0
  5. .
  6. .de1 rstReportMargin
  7. \\$1 \\n[an-margin]
  8. level \\n[rst2man-indent-level]
  9. level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
  10. -
  11. \\n[rst2man-indent0]
  12. \\n[rst2man-indent1]
  13. \\n[rst2man-indent2]
  14. ..
  15. .de1 INDENT
  16. .\" .rstReportMargin pre:
  17. . RS \\$1
  18. . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
  19. . nr rst2man-indent-level +1
  20. .\" .rstReportMargin post:
  21. ..
  22. .de UNINDENT
  23. . RE
  24. .\" indent \\n[an-margin]
  25. .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
  26. .nr rst2man-indent-level -1
  27. .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
  28. .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
  29. ..
  30. .TH "BORG-IMPORT-TAR" 1 "2023-09-14" "" "borg backup tool"
  31. .SH NAME
  32. borg-import-tar \- Create a backup archive from a tarball
  33. .SH SYNOPSIS
  34. .sp
  35. borg [common options] import\-tar [options] NAME TARFILE
  36. .SH DESCRIPTION
  37. .sp
  38. This command creates a backup archive from a tarball.
  39. .sp
  40. When giving \(aq\-\(aq as path, Borg will read a tar stream from standard input.
  41. .sp
  42. By default (\-\-tar\-filter=auto) Borg will detect whether the file is compressed
  43. based on its file extension and pipe the file through an appropriate filter:
  44. .INDENT 0.0
  45. .IP \(bu 2
  46. \&.tar.gz or .tgz: gzip \-d
  47. .IP \(bu 2
  48. \&.tar.bz2 or .tbz: bzip2 \-d
  49. .IP \(bu 2
  50. \&.tar.xz or .txz: xz \-d
  51. .IP \(bu 2
  52. \&.tar.zstd or .tar.zst: zstd \-d
  53. .IP \(bu 2
  54. \&.tar.lz4: lz4 \-d
  55. .UNINDENT
  56. .sp
  57. Alternatively, a \-\-tar\-filter program may be explicitly specified. It should
  58. read compressed data from stdin and output an uncompressed tar stream on
  59. stdout.
  60. .sp
  61. Most documentation of borg create applies. Note that this command does not
  62. support excluding files.
  63. .sp
  64. A \fB\-\-sparse\fP option (as found in borg create) is not supported.
  65. .sp
  66. About tar formats and metadata conservation or loss, please see \fBborg export\-tar\fP\&.
  67. .sp
  68. import\-tar reads these tar formats:
  69. .INDENT 0.0
  70. .IP \(bu 2
  71. BORG: borg specific (PAX\-based)
  72. .IP \(bu 2
  73. PAX: POSIX.1\-2001
  74. .IP \(bu 2
  75. GNU: GNU tar
  76. .IP \(bu 2
  77. POSIX.1\-1988 (ustar)
  78. .IP \(bu 2
  79. UNIX V7 tar
  80. .IP \(bu 2
  81. SunOS tar with extended attributes
  82. .UNINDENT
  83. .sp
  84. To import multiple tarballs into a single archive, they can be simply
  85. concatenated (e.g. using \(dqcat\(dq) into a single file, and imported with an
  86. \fB\-\-ignore\-zeros\fP option to skip through the stop markers between them.
  87. .SH OPTIONS
  88. .sp
  89. See \fIborg\-common(1)\fP for common options of Borg commands.
  90. .SS arguments
  91. .INDENT 0.0
  92. .TP
  93. .B NAME
  94. specify the archive name
  95. .TP
  96. .B TARFILE
  97. input tar file. \(dq\-\(dq to read from stdin instead.
  98. .UNINDENT
  99. .SS options
  100. .INDENT 0.0
  101. .TP
  102. .B \-\-tar\-filter
  103. filter program to pipe data through
  104. .TP
  105. .B \-s\fP,\fB \-\-stats
  106. print statistics for the created archive
  107. .TP
  108. .B \-\-list
  109. output verbose list of items (files, dirs, ...)
  110. .TP
  111. .BI \-\-filter \ STATUSCHARS
  112. only display items with the given status characters
  113. .TP
  114. .B \-\-json
  115. output stats as JSON (implies \-\-stats)
  116. .TP
  117. .B \-\-ignore\-zeros
  118. ignore zero\-filled blocks in the input tarball
  119. .UNINDENT
  120. .SS Archive options
  121. .INDENT 0.0
  122. .TP
  123. .BI \-\-comment \ COMMENT
  124. add a comment text to the archive
  125. .TP
  126. .BI \-\-timestamp \ TIMESTAMP
  127. 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.
  128. .TP
  129. .BI \-c \ SECONDS\fR,\fB \ \-\-checkpoint\-interval \ SECONDS
  130. write checkpoint every SECONDS seconds (Default: 1800)
  131. .TP
  132. .BI \-\-checkpoint\-volume \ BYTES
  133. write checkpoint every BYTES bytes (Default: 0, meaning no volume based checkpointing)
  134. .TP
  135. .BI \-\-chunker\-params \ PARAMS
  136. specify the chunker parameters (ALGO, CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS, HASH_WINDOW_SIZE). default: buzhash,19,23,21,4095
  137. .TP
  138. .BI \-C \ COMPRESSION\fR,\fB \ \-\-compression \ COMPRESSION
  139. select compression algorithm, see the output of the \(dqborg help compression\(dq command for details.
  140. .UNINDENT
  141. .SH EXAMPLES
  142. .INDENT 0.0
  143. .INDENT 3.5
  144. .sp
  145. .nf
  146. .ft C
  147. # export as uncompressed tar
  148. $ borg export\-tar Monday Monday.tar
  149. # import an uncompressed tar
  150. $ borg import\-tar Monday Monday.tar
  151. # exclude some file types, compress using gzip
  152. $ borg export\-tar Monday Monday.tar.gz \-\-exclude \(aq*.so\(aq
  153. # use higher compression level with gzip
  154. $ borg export\-tar \-\-tar\-filter=\(dqgzip \-9\(dq Monday Monday.tar.gz
  155. # copy an archive from repoA to repoB
  156. $ borg \-r repoA export\-tar \-\-tar\-format=BORG archive \- | borg \-r repoB import\-tar archive \-
  157. # export a tar, but instead of storing it on disk, upload it to remote site using curl
  158. $ borg export\-tar Monday \- | curl \-\-data\-binary @\- https://somewhere/to/POST
  159. # remote extraction via \(dqtarpipe\(dq
  160. $ borg export\-tar Monday \- | ssh somewhere \(dqcd extracted; tar x\(dq
  161. .ft P
  162. .fi
  163. .UNINDENT
  164. .UNINDENT
  165. .SS Archives transfer script
  166. .sp
  167. Outputs a script that copies all archives from repo1 to repo2:
  168. .INDENT 0.0
  169. .INDENT 3.5
  170. .sp
  171. .nf
  172. .ft C
  173. for A T in \(gaborg list \-\-format=\(aq{archive} {time:%Y\-%m\-%dT%H:%M:%S}{NL}\(aq\(ga
  174. do
  175. echo \(dqborg \-r repo1 export\-tar \-\-tar\-format=BORG $A \- | borg \-r repo2 import\-tar \-\-timestamp=$T $A \-\(dq
  176. done
  177. .ft P
  178. .fi
  179. .UNINDENT
  180. .UNINDENT
  181. .sp
  182. Kept:
  183. .INDENT 0.0
  184. .IP \(bu 2
  185. archive name, archive timestamp
  186. .IP \(bu 2
  187. archive contents (all items with metadata and data)
  188. .UNINDENT
  189. .sp
  190. Lost:
  191. .INDENT 0.0
  192. .IP \(bu 2
  193. some archive metadata (like the original commandline, execution time, etc.)
  194. .UNINDENT
  195. .sp
  196. Please note:
  197. .INDENT 0.0
  198. .IP \(bu 2
  199. all data goes over that pipe, again and again for every archive
  200. .IP \(bu 2
  201. the pipe is dumb, there is no data or transfer time reduction there due to deduplication
  202. .IP \(bu 2
  203. maybe add compression
  204. .IP \(bu 2
  205. pipe over ssh for remote transfer
  206. .IP \(bu 2
  207. no special sparse file support
  208. .UNINDENT
  209. .SH SEE ALSO
  210. .sp
  211. \fIborg\-common(1)\fP
  212. .SH AUTHOR
  213. The Borg Collective
  214. .\" Generated by docutils manpage writer.
  215. .