cmp(1) will of course tell me if the contents of two files are identical, but in order to test restoring from backups I also wanted to compare the relevant (!) file attributes.
So if I did something simple like
mv foo.bar foo.bar.save deja-dup --restore foo.bar # or some other backup tool
how do I compare the attributes of foo.bar and foo.bar.save and test for sufficient equality in a shell script (or similar). I can do
and manually inspect the output remembering to ignore inode, atime, and ctime (as well as link count, for some reason?), but this is error prone. Is there a cmp-with-attributes tool somewhere which include SELinux and other attributes? Must work on Fedora and ext4 file systems; ideally on "all" systems. Do I need to hack something up in perl?
(No point having backups if you don't test that they work right.)