borg-extract.1 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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-10-31" "" "borg backup tool"
  31. .SH NAME
  32. borg-extract \- Extract archive contents
  33. .SH SYNOPSIS
  34. .sp
  35. borg [common options] extract [options] ARCHIVE [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 ARCHIVE
  74. archive to extract
  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 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\-owner
  89. deprecated, use \fB\-\-numeric\-ids\fP instead
  90. .TP
  91. .B \-\-numeric\-ids
  92. only obey numeric user and group identifiers
  93. .TP
  94. .B \-\-nobsdflags
  95. deprecated, use \fB\-\-noflags\fP instead
  96. .TP
  97. .B \-\-noflags
  98. do not extract/set flags (e.g. NODUMP, IMMUTABLE)
  99. .TP
  100. .B \-\-noacls
  101. do not extract/set ACLs
  102. .TP
  103. .B \-\-noxattrs
  104. do not extract/set xattrs
  105. .TP
  106. .B \-\-stdout
  107. write all extracted data to stdout
  108. .TP
  109. .B \-\-sparse
  110. create holes in output sparse file from all\-zero chunks
  111. .UNINDENT
  112. .SS Include/Exclude options
  113. .INDENT 0.0
  114. .TP
  115. .BI \-e \ PATTERN\fR,\fB \ \-\-exclude \ PATTERN
  116. exclude paths matching PATTERN
  117. .TP
  118. .BI \-\-exclude\-from \ EXCLUDEFILE
  119. read exclude patterns from EXCLUDEFILE, one per line
  120. .TP
  121. .BI \-\-pattern \ PATTERN
  122. include/exclude paths matching PATTERN
  123. .TP
  124. .BI \-\-patterns\-from \ PATTERNFILE
  125. read include/exclude patterns from PATTERNFILE, one per line
  126. .TP
  127. .BI \-\-strip\-components \ NUMBER
  128. Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped.
  129. .UNINDENT
  130. .SH EXAMPLES
  131. .INDENT 0.0
  132. .INDENT 3.5
  133. .sp
  134. .EX
  135. # Extract entire archive
  136. $ borg extract /path/to/repo::my\-files
  137. # Extract entire archive and list files while processing
  138. $ borg extract \-\-list /path/to/repo::my\-files
  139. # Verify whether an archive could be successfully extracted, but do not write files to disk
  140. $ borg extract \-\-dry\-run /path/to/repo::my\-files
  141. # Extract the \(dqsrc\(dq directory
  142. $ borg extract /path/to/repo::my\-files home/USERNAME/src
  143. # Extract the \(dqsrc\(dq directory but exclude object files
  144. $ borg extract /path/to/repo::my\-files home/USERNAME/src \-\-exclude \(aq*.o\(aq
  145. # Extract only the C files
  146. $ borg extract /path/to/repo::my\-files \(aqsh:home/USERNAME/src/*.c\(aq
  147. # Restore a raw device (must not be active/in use/mounted at that time)
  148. $ borg extract \-\-stdout /path/to/repo::my\-sdx | dd of=/dev/sdx bs=10M
  149. .EE
  150. .UNINDENT
  151. .UNINDENT
  152. .SH SEE ALSO
  153. .sp
  154. \fIborg\-common(1)\fP, \fIborg\-mount(1)\fP
  155. .SH AUTHOR
  156. The Borg Collective
  157. .\" Generated by docutils manpage writer.
  158. .