Questo contenuto non è disponibile nella lingua selezionata.

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.
diff
The diff command shows a diff of modified files and directories between two snapshots as received from the status command if there is at least one modification detected.
xadiff
The xadiff command compares how the extended attributes of a file or directory have changed between two snapshots.

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
OutputMeaning
.Nothing has changed.
+File created.
-File deleted.
cContent changed.
tThe 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
OutputMeaning
.No permissions changed.
pPermissions changed.
Column 3 indicates any changes in the user ownership. Possible values are:
Column 3
OutputMeaning
.No user ownership changed.
uUser ownership has changed.
Column 4 indicates any changes in the group ownership. Possible values are:
Column 4
OutputMeaning
.No group ownership changed.
gGroup ownership has changed.
Column 5 indicates any changes in the extended attributes. Possible values are:
Column 5
OutputMeaning
.No extended attributes changed.
xExtended attributes changed.
Column 6 indicates any changes in the access control lists (ACLs). Possible values are:
Column 6
OutputMeaning
.No ACLs changed.
aACLs 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
Red Hat logoGithubRedditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita ilBlog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

© 2024 Red Hat, Inc.