File: diff.rst

package info (click to toggle)
borgbackup2 2.0.0b20-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 16,848 kB
  • sloc: python: 33,830; pascal: 3,599; sh: 215; makefile: 160; tcl: 94; ansic: 21
file content (26 lines) | stat: -rw-r--r-- 1,018 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
.. include:: diff.rst.inc

Examples
~~~~~~~~
::

    $ borg diff archive1 archive2
        +17 B      -5 B [-rw-r--r-- -> -rwxr-xr-x] file1
       +135 B    -252 B file2
    added           0 B file4
    removed         0 B file3

    $ borg diff archive1 archive2
    {"path": "file1", "changes": [{"type": "modified", "added": 17, "removed": 5}, {"type": "mode", "old_mode": "-rw-r--r--", "new_mode": "-rwxr-xr-x"}]}
    {"path": "file2", "changes": [{"type": "modified", "added": 135, "removed": 252}]}
    {"path": "file4", "changes": [{"type": "added", "size": 0}]}
    {"path": "file3", "changes": [{"type": "removed", "size": 0}]}


    # Use --sort-by with a comma-separated list; sorts apply stably from last to first.
    # Here: primary by net size change descending, tie-breaker by path ascending
    $ borg diff --sort-by=">size_diff,path" archive1 archive2
        +17 B      -5 B [-rw-r--r-- -> -rwxr-xr-x] file1
    removed         0 B file3
    added           0 B file4
       +135 B    -252 B file2