Este contenido no está disponible en el idioma seleccionado.

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

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

© 2024 Red Hat, Inc.