borg-diff.1 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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-DIFF" "1" "2025-05-19" "" "borg backup tool"
  31. .SH NAME
  32. borg-diff \- Diff contents of two archives
  33. .SH SYNOPSIS
  34. .sp
  35. borg [common options] diff [options] ARCHIVE1 ARCHIVE2 [PATH...]
  36. .SH DESCRIPTION
  37. .sp
  38. This command finds differences (file contents, metadata) between ARCHIVE1 and ARCHIVE2.
  39. .sp
  40. For more help on include/exclude patterns, see the \fIborg_patterns\fP command output.
  41. .SH OPTIONS
  42. .sp
  43. See \fIborg\-common(1)\fP for common options of Borg commands.
  44. .SS arguments
  45. .INDENT 0.0
  46. .TP
  47. .B ARCHIVE1
  48. ARCHIVE1 name
  49. .TP
  50. .B ARCHIVE2
  51. ARCHIVE2 name
  52. .TP
  53. .B PATH
  54. paths of items inside the archives to compare; patterns are supported
  55. .UNINDENT
  56. .SS options
  57. .INDENT 0.0
  58. .TP
  59. .B \-\-numeric\-ids
  60. only consider numeric user and group identifiers
  61. .TP
  62. .B \-\-same\-chunker\-params
  63. Override check of chunker parameters.
  64. .TP
  65. .B \-\-sort
  66. Sort the output lines by file path.
  67. .TP
  68. .BI \-\-format \ FORMAT
  69. specify format for differences between archives (default: \(dq{change} {path}{NL}\(dq)
  70. .TP
  71. .B \-\-json\-lines
  72. Format output as JSON Lines.
  73. .TP
  74. .B \-\-content\-only
  75. Only compare differences in content (exclude metadata differences)
  76. .UNINDENT
  77. .SS Include/Exclude options
  78. .INDENT 0.0
  79. .TP
  80. .BI \-e \ PATTERN\fR,\fB \ \-\-exclude \ PATTERN
  81. exclude paths matching PATTERN
  82. .TP
  83. .BI \-\-exclude\-from \ EXCLUDEFILE
  84. read exclude patterns from EXCLUDEFILE, one per line
  85. .TP
  86. .BI \-\-pattern \ PATTERN
  87. include/exclude paths matching PATTERN
  88. .TP
  89. .BI \-\-patterns\-from \ PATTERNFILE
  90. read include/exclude patterns from PATTERNFILE, one per line
  91. .UNINDENT
  92. .SH EXAMPLES
  93. .INDENT 0.0
  94. .INDENT 3.5
  95. .sp
  96. .EX
  97. $ borg diff archive1 archive2
  98. +17 B \-5 B [\-rw\-r\-\-r\-\- \-> \-rwxr\-xr\-x] file1
  99. +135 B \-252 B file2
  100. added 0 B file4
  101. removed 0 B file3
  102. $ borg diff archive1 archive2
  103. {\(dqpath\(dq: \(dqfile1\(dq, \(dqchanges\(dq: [{\(dqtype\(dq: \(dqmodified\(dq, \(dqadded\(dq: 17, \(dqremoved\(dq: 5}, {\(dqtype\(dq: \(dqmode\(dq, \(dqold_mode\(dq: \(dq\-rw\-r\-\-r\-\-\(dq, \(dqnew_mode\(dq: \(dq\-rwxr\-xr\-x\(dq}]}
  104. {\(dqpath\(dq: \(dqfile2\(dq, \(dqchanges\(dq: [{\(dqtype\(dq: \(dqmodified\(dq, \(dqadded\(dq: 135, \(dqremoved\(dq: 252}]}
  105. {\(dqpath\(dq: \(dqfile4\(dq, \(dqchanges\(dq: [{\(dqtype\(dq: \(dqadded\(dq, \(dqsize\(dq: 0}]}
  106. {\(dqpath\(dq: \(dqfile3\(dq, \(dqchanges\(dq: [{\(dqtype\(dq: \(dqremoved\(dq, \(dqsize\(dq: 0}]}
  107. .EE
  108. .UNINDENT
  109. .UNINDENT
  110. .SH NOTES
  111. .SS The FORMAT specifier syntax
  112. .sp
  113. The \fB\-\-format\fP option uses python\(aqs format string syntax <https://docs.python.org/3.9/library/string.html#formatstrings>
  114. \&.
  115. .sp
  116. Examples:
  117. .INDENT 0.0
  118. .INDENT 3.5
  119. .sp
  120. .EX
  121. $ borg diff \-\-format \(aq{content:30} {path}{NL}\(aq ArchiveFoo ArchiveBar
  122. modified: +4.1 kB \-1.0 kB file\-diff
  123. \&...
  124. # {VAR:<NUMBER} \- pad to NUMBER columns left\-aligned.
  125. # {VAR:>NUMBER} \- pad to NUMBER columns right\-aligned.
  126. $ borg diff \-\-format \(aq{content:>30} {path}{NL}\(aq ArchiveFoo ArchiveBar
  127. modified: +4.1 kB \-1.0 kB file\-diff
  128. \&...
  129. .EE
  130. .UNINDENT
  131. .UNINDENT
  132. .sp
  133. The following keys are always available:
  134. .INDENT 0.0
  135. .IP \(bu 2
  136. NEWLINE: OS dependent line separator
  137. .IP \(bu 2
  138. NL: alias of NEWLINE
  139. .IP \(bu 2
  140. NUL: NUL character for creating print0 / xargs \-0 like output
  141. .IP \(bu 2
  142. SPACE: space character
  143. .IP \(bu 2
  144. TAB: tab character
  145. .IP \(bu 2
  146. CR: carriage return character
  147. .IP \(bu 2
  148. LF: line feed character
  149. .UNINDENT
  150. .sp
  151. Keys available only when showing differences between archives:
  152. .INDENT 0.0
  153. .IP \(bu 2
  154. path: archived file path
  155. .IP \(bu 2
  156. change: all available changes
  157. .IP \(bu 2
  158. content: file content change
  159. .IP \(bu 2
  160. mode: file mode change
  161. .IP \(bu 2
  162. type: file type change
  163. .IP \(bu 2
  164. owner: file owner (user/group) change
  165. .IP \(bu 2
  166. group: file group change
  167. .IP \(bu 2
  168. user: file user change
  169. .IP \(bu 2
  170. link: file link change
  171. .IP \(bu 2
  172. directory: file directory change
  173. .IP \(bu 2
  174. blkdev: file block device change
  175. .IP \(bu 2
  176. chrdev: file character device change
  177. .IP \(bu 2
  178. fifo: file fifo change
  179. .IP \(bu 2
  180. mtime: file modification time change
  181. .IP \(bu 2
  182. ctime: file change time change
  183. .IP \(bu 2
  184. isomtime: file modification time change (ISO 8601)
  185. .IP \(bu 2
  186. isoctime: file creation time change (ISO 8601)
  187. .UNINDENT
  188. .SH SEE ALSO
  189. .sp
  190. \fIborg\-common(1)\fP
  191. .SH AUTHOR
  192. The Borg Collective
  193. .\" Generated by docutils manpage writer.
  194. .