exclude socket files during diff -r

diff has an option --recursive (-r) to do a comparison between two directories (the files inside them). Is there a way to make diff ignore all socket files and only socket files?

I am using diff --brief -r --no-dereference /var/ /media/mateusz/Database/tmp/duplicity_unpack/var/ to verify part of my backup and I am flooded by entries like Only in /var/lib/samba/private/msg.sock: 10001. These files are socket files that Duplicity failed to backup - and it is not indicating a failed backup.

I am aware that I may write my own processing of output but it has potential for bugs, requires more time and requires me to maintain list of socket files in the filesystem.

Note that empty folders should not be ignored in the comparison.

4 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like