Fork me on GitHub

diff

plakar diff

The plakar diff command performs a diff between two snapshots, without restoring them.

If provided with two snapshot identifiers, the command will perform an inode diff by checking if permissions, ownership or modification date has changed:

$ plakar diff b3 b6
$ sudo touch /private/etc/bleh
$ plakar push /private/etc
$ plakar ls                   
2021-10-06T19:46:58Z b3bdb2b0-115a-4198-93a4-976edf883eb5 3.1 MB (files: 248, dirs: 42)
2021-10-06T19:49:51Z b68a8f07-da5e-4b01-bd1a-78aa8156f871 3.1 MB (files: 248, dirs: 42)
2021-10-06T19:55:19Z 45509672-f314-431a-9999-5a9eaa09a98b 3.1 MB (files: 249, dirs: 42)
$ plakar diff b3 45
-  drwxr-xr-x     root    wheel   2.9 kB 2021-09-26 20:45:08.587949603 +0000 UTC /private/etc/
+  drwxr-xr-x     root    wheel   2.9 kB 2021-10-06 19:54:55.675866163 +0000 UTC /private/etc/
+  -rw-r--r--     root    wheel      0 B 2021-10-06 19:54:55.67585958 +0000 UTC /private/etc/bleh

If provided with a file argument as third parameter, the command will perform a file diff between the file present in both snapshots without restoring them:

# echo _foobar:*:442:_foobar >> /private/etc/group
$ plakar push /private/etc/group
$ plakar ls
2021-10-06T19:46:58Z b3bdb2b0-115a-4198-93a4-976edf883eb5 3.1 MB (files: 248, dirs: 42)
2021-10-06T19:49:51Z b68a8f07-da5e-4b01-bd1a-78aa8156f871 3.1 MB (files: 248, dirs: 42)
2021-10-06T19:55:19Z 45509672-f314-431a-9999-5a9eaa09a98b 3.1 MB (files: 249, dirs: 42)
2021-10-06T20:00:01Z a0dee33e-568e-4946-9be3-a987f939a351 3.1 MB (files: 249, dirs: 42)
$ plakar diff b3 a0 /private/etc/group
--- b3bdb2b0-115a-4198-93a4-976edf883eb5:/private/etc/group
+++ a0dee33e-568e-4946-9be3-a987f939a351:/private/etc/group
@@ -145,4 +145,5 @@
 com.apple.access_ssh:*:399:
 com.apple.access_remote_ae:*:400:
 _oahd:*:441:_oahd
+_foobar:*:442:_foobar