2
0

borg-extract.1 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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-EXTRACT" "1" "2025-12-23" "" "borg backup tool"
  31. .SH NAME
  32. borg-extract \- Extracts archive contents.
  33. .SH SYNOPSIS
  34. .sp
  35. borg [common options] extract [options] NAME [PATH...]
  36. .SH DESCRIPTION
  37. .sp
  38. This command extracts the contents of an archive.
  39. .sp
  40. By default, the entire archive is extracted, but a subset of files and directories
  41. can be selected by passing a list of \fBPATH\fP arguments. The default interpretation
  42. for the paths to extract is \fIpp:\fP which is a literal path\-prefix match. If you want
  43. to use e.g. a wildcard, you must select a different pattern style such as \fIsh:\fP or
  44. \fIfm:\fP\&. See \fIborg_patterns\fP for more information.
  45. .sp
  46. The file selection can be further restricted by using the \fB\-\-exclude\fP option.
  47. For more help on include/exclude patterns, see the \fIborg_patterns\fP command output.
  48. .sp
  49. By using \fB\-\-dry\-run\fP, you can do all extraction steps except actually writing the
  50. output data: reading metadata and data chunks from the repository, checking the hash/HMAC,
  51. decrypting, and decompressing.
  52. .sp
  53. \fB\-\-progress\fP can be slower than no progress display, since it makes one additional
  54. pass over the archive metadata.
  55. .sp
  56. \fBNOTE:\fP
  57. .INDENT 0.0
  58. .INDENT 3.5
  59. Currently, extract always writes into the current working directory (\(dq.\(dq),
  60. so make sure you \fBcd\fP to the right place before calling \fBborg extract\fP\&.
  61. .sp
  62. When parent directories are not extracted (because of using file/directory selection
  63. or any other reason), Borg cannot restore parent directories\(aq metadata, e.g., owner,
  64. group, permissions, etc.
  65. .UNINDENT
  66. .UNINDENT
  67. .SH OPTIONS
  68. .sp
  69. See \fIborg\-common(1)\fP for common options of Borg commands.
  70. .SS arguments
  71. .INDENT 0.0
  72. .TP
  73. .B NAME
  74. specify the archive name
  75. .TP
  76. .B PATH
  77. paths to extract; patterns are supported
  78. .UNINDENT
  79. .SS options
  80. .INDENT 0.0
  81. .TP
  82. .B \-\-list
  83. output a verbose list of items (files, dirs, ...)
  84. .TP
  85. .B \-n\fP,\fB \-\-dry\-run
  86. do not actually change any files
  87. .TP
  88. .B \-\-numeric\-ids
  89. only use numeric user and group identifiers
  90. .TP
  91. .B \-\-noflags
  92. do not extract/set flags (e.g. NODUMP, IMMUTABLE)
  93. .TP
  94. .B \-\-noacls
  95. do not extract/set ACLs
  96. .TP
  97. .B \-\-noxattrs
  98. do not extract/set xattrs
  99. .TP
  100. .B \-\-stdout
  101. write all extracted data to stdout
  102. .TP
  103. .B \-\-sparse
  104. create holes in the output sparse file from all\-zero chunks
  105. .TP
  106. .B \-\-continue
  107. continue a previously interrupted extraction of the same archive
  108. .UNINDENT
  109. .SS Include/Exclude options
  110. .INDENT 0.0
  111. .TP
  112. .BI \-e \ PATTERN\fR,\fB \ \-\-exclude \ PATTERN
  113. exclude paths matching PATTERN
  114. .TP
  115. .BI \-\-exclude\-from \ EXCLUDEFILE
  116. read exclude patterns from EXCLUDEFILE, one per line
  117. .TP
  118. .BI \-\-pattern \ PATTERN
  119. include/exclude paths matching PATTERN
  120. .TP
  121. .BI \-\-patterns\-from \ PATTERNFILE
  122. read include/exclude patterns from PATTERNFILE, one per line
  123. .TP
  124. .BI \-\-strip\-components \ NUMBER
  125. Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped.
  126. .UNINDENT
  127. .SH EXAMPLES
  128. .INDENT 0.0
  129. .INDENT 3.5
  130. .sp
  131. .EX
  132. # Extract entire archive
  133. $ borg extract my\-files
  134. # Extract entire archive and list files while processing
  135. $ borg extract \-\-list my\-files
  136. # Verify whether an archive could be successfully extracted, but do not write files to disk
  137. $ borg extract \-\-dry\-run my\-files
  138. # Extract the \(dqsrc\(dq directory
  139. $ borg extract my\-files home/USERNAME/src
  140. # Extract the \(dqsrc\(dq directory but exclude object files
  141. $ borg extract my\-files home/USERNAME/src \-\-exclude \(aq*.o\(aq
  142. # Extract only the C files
  143. $ borg extract my\-files \(aqsh:home/USERNAME/src/*.c\(aq
  144. # Restore a raw device (must not be active/in use/mounted at that time)
  145. $ borg extract \-\-stdout my\-sdx | dd of=/dev/sdx bs=10M
  146. .EE
  147. .UNINDENT
  148. .UNINDENT
  149. .SH SEE ALSO
  150. .sp
  151. \fIborg\-common(1)\fP, \fIborg\-mount(1)\fP
  152. .SH AUTHOR
  153. The Borg Collective
  154. .\" Generated by docutils manpage writer.
  155. .