14.3. Tracking Changes Between Snapper Snapshots
Use the
status
, diff
, and xadiff
commands to track the changes made to a subvolume between snapshots:
- status
- The
status
command shows a list of files and directories that have been created, modified, or deleted between two snapshots, that is a comprehensive list of changes between two snapshots. You can use this command to get an overview of the changes without excessive details.For more information, see Section 14.3.1, “Comparing Changes with thestatus
Command”. - diff
- The
diff
command shows a diff of modified files and directories between two snapshots as received from thestatus
command if there is at least one modification detected.For more information, see Section 14.3.2, “Comparing Changes with thediff
Command”. - xadiff
- The
xadiff
command compares how the extended attributes of a file or directory have changed between two snapshots.For more information, see Section 14.3.3, “Comparing Changes with thexadiff
Command”.
14.3.1. Comparing Changes with the status
Command
The
status
command shows a list of files and directories that have been created, modified, or deleted between two snapshots.
To display the status of files between two snapshots, use:
#
snapper -c config_file status first_snapshot_number..second_snapshot_number
Use the
list
command to determine snapshot numbers if needed.
For example, the following command displays the changes made between snapshot 1 and 2, using the configuration file
lvm_config
.
#
snapper -c lvm_config status 1..2
tp.... /lvm_mount/dir1 -..... /lvm_mount/dir1/file_a c.ug.. /lvm_mount/file2 +..... /lvm_mount/file3 ....x. /lvm_mount/file4 cp..xa /lvm_mount/file5
Read letters and dots in the first part of the output as columns:
+..... /lvm_mount/file3 |||||| 123456
Column 1 indicates any modification of the file (directory entry) type. Possible values are:
Column 1
Output | Meaning |
---|---|
. | Nothing has changed. |
+ | File created. |
- | File deleted. |
c | Content changed. |
t | The type of directory entry has changed. For example, a former symbolic link has changed to a regular file with the same file name. |
Column 2 indicates any changes in the file permissions. Possible values are:
Column 2
Output | Meaning |
---|---|
. | No permissions changed. |
p | Permissions changed. |
Column 3 indicates any changes in the user ownership. Possible values are:
Column 3
Output | Meaning |
---|---|
. | No user ownership changed. |
u | User ownership has changed. |
Column 4 indicates any changes in the group ownership. Possible values are:
Column 4
Output | Meaning |
---|---|
. | No group ownership changed. |
g | Group ownership has changed. |
Column 5 indicates any changes in the extended attributes. Possible values are:
Column 5
Output | Meaning |
---|---|
. | No extended attributes changed. |
x | Extended attributes changed. |
Column 6 indicates any changes in the access control lists (ACLs). Possible values are:
Column 6
Output | Meaning |
---|---|
. | No ACLs changed. |
a | ACLs modified. |
14.3.2. Comparing Changes with the diff
Command
The
diff
command shows the changes of modified files and directories between two snapshots.
#
snapper -c config_name diff first_snapshot_number..second_snapshot_number
Use the
list
command to determine the number of the snapshot if needed.
For example, to compare the changes made in files between snapshot 1 and snapshot 2 that were made using the
lvm_config
configuration file, use:
#
snapper -c lvm_config diff 1..2
--- /lvm_mount/.snapshots/13/snapshot/file4 19<...> +++ /lvm_mount/.snapshots/14/snapshot/file4 20<...> @@ -0,0 +1 @@ +words
This output shows that
file4
had been modified to add "words" into the file.
14.3.3. Comparing Changes with the xadiff
Command
The
xadiff
command compares how the extended attributes of a file or directory have changed between two snapshots:
#
snapper -c config_name xadiff first_snapshot_number..second_snapshot_number
Use the
list
command to determine the number of the snapshot if needed.
For example, to show the xadiff output between snapshot number 1 and snapshot number 2 that were made using the
lvm_config
configuration file, use:
#
snapper -c lvm_config xadiff 1..2