borg-extract.1 4.2 KB

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