crm_diff — identify changes to the cluster configuration and apply patches to the configuration files
The crm_diff command assists in creating and applying XML patches. This can be useful for visualizing the changes between two versions of the cluster configuration or saving changes so they can be applied at a later time using cibadmin.
--help, -?
Print a help message.
--original filename,
-o filename
Specify the original file against which to diff or apply patches.
--new filename,
-n filename
Specify the name of the new file.
--original-string string,
-O string
Specify the original string against which to diff or apply patches.
--new-string string,
-N string
Specify the new string.
--patch filename,
-p filename
Apply a patch to the original XML. Always use with
-o.
--cib, -c
Compare or patch the inputs as a CIB. Always specify the base version
with -o and provide either the patch file or the
second version with -p or -n,
respectively.
--stdin, -s
Read the inputs from stdin.
Use crm_diff to determine the differences between various CIB configuration files and to create patches. By means of patches, easily reuse configuration parts without having to use the cibadmin command on every single one of them.
Obtain the two different configuration files by running cibadmin on the two cluster setups to compare:
cibadmin-Q>cib1.xml cibadmin-Q>cib2.xml
Determine whether to diff the entire files against each other or compare just a subset of the configurations.
To print the difference between the files to stdout, use the following command:
crm_diff-ocib1.xml-ncib2.xml
To print the difference between the files to a file and create a patch, use the following command:
crm_diff-ocib1.xml-ncib2.xml >patch.xml
Apply the patch to the original file:
crm_diff-ocib1.xml-ppatch.xml