exclude socket files during diff -r





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







1















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.










share|improve this question

























  • If all the socket files are identified by a .sock suffix, then you should be able to exclude them from comparison using a simple glob pattern by adding --exclude='*.sock'

    – steeldriver
    Jul 9 '16 at 14:21











  • Unfortunately, most of socket files in my system is not using *.sock extension (and I am not one that controls how filenames were selected) - for example all files in /var/lib/samba/private/msg.sock are composed from numbers and only from numbers.

    – Mateusz Konieczny
    Jul 9 '16 at 14:26











  • Sorry, I misread (and didn't check on my own system) that the sockets are numerically named files within a directory called /var/lib/samba/private/msg.sock - I don't understand why you can't simply exclude the directory e.g. --exclude='msg.sock' or --exclude='*.sock'

    – steeldriver
    Jul 9 '16 at 15:12











  • @steeldriver Currently I am manually excluding directories, but I would prefer something less prone to failure and requiring less maintenance.

    – Mateusz Konieczny
    Jul 10 '16 at 18:04




















1















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.










share|improve this question

























  • If all the socket files are identified by a .sock suffix, then you should be able to exclude them from comparison using a simple glob pattern by adding --exclude='*.sock'

    – steeldriver
    Jul 9 '16 at 14:21











  • Unfortunately, most of socket files in my system is not using *.sock extension (and I am not one that controls how filenames were selected) - for example all files in /var/lib/samba/private/msg.sock are composed from numbers and only from numbers.

    – Mateusz Konieczny
    Jul 9 '16 at 14:26











  • Sorry, I misread (and didn't check on my own system) that the sockets are numerically named files within a directory called /var/lib/samba/private/msg.sock - I don't understand why you can't simply exclude the directory e.g. --exclude='msg.sock' or --exclude='*.sock'

    – steeldriver
    Jul 9 '16 at 15:12











  • @steeldriver Currently I am manually excluding directories, but I would prefer something less prone to failure and requiring less maintenance.

    – Mateusz Konieczny
    Jul 10 '16 at 18:04
















1












1








1








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.










share|improve this question
















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.







command-line diff sockets






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 24 at 8:48









Sergiy Kolodyazhnyy

75.1k9155327




75.1k9155327










asked Jul 9 '16 at 14:08









Mateusz KoniecznyMateusz Konieczny

598627




598627













  • If all the socket files are identified by a .sock suffix, then you should be able to exclude them from comparison using a simple glob pattern by adding --exclude='*.sock'

    – steeldriver
    Jul 9 '16 at 14:21











  • Unfortunately, most of socket files in my system is not using *.sock extension (and I am not one that controls how filenames were selected) - for example all files in /var/lib/samba/private/msg.sock are composed from numbers and only from numbers.

    – Mateusz Konieczny
    Jul 9 '16 at 14:26











  • Sorry, I misread (and didn't check on my own system) that the sockets are numerically named files within a directory called /var/lib/samba/private/msg.sock - I don't understand why you can't simply exclude the directory e.g. --exclude='msg.sock' or --exclude='*.sock'

    – steeldriver
    Jul 9 '16 at 15:12











  • @steeldriver Currently I am manually excluding directories, but I would prefer something less prone to failure and requiring less maintenance.

    – Mateusz Konieczny
    Jul 10 '16 at 18:04





















  • If all the socket files are identified by a .sock suffix, then you should be able to exclude them from comparison using a simple glob pattern by adding --exclude='*.sock'

    – steeldriver
    Jul 9 '16 at 14:21











  • Unfortunately, most of socket files in my system is not using *.sock extension (and I am not one that controls how filenames were selected) - for example all files in /var/lib/samba/private/msg.sock are composed from numbers and only from numbers.

    – Mateusz Konieczny
    Jul 9 '16 at 14:26











  • Sorry, I misread (and didn't check on my own system) that the sockets are numerically named files within a directory called /var/lib/samba/private/msg.sock - I don't understand why you can't simply exclude the directory e.g. --exclude='msg.sock' or --exclude='*.sock'

    – steeldriver
    Jul 9 '16 at 15:12











  • @steeldriver Currently I am manually excluding directories, but I would prefer something less prone to failure and requiring less maintenance.

    – Mateusz Konieczny
    Jul 10 '16 at 18:04



















If all the socket files are identified by a .sock suffix, then you should be able to exclude them from comparison using a simple glob pattern by adding --exclude='*.sock'

– steeldriver
Jul 9 '16 at 14:21





If all the socket files are identified by a .sock suffix, then you should be able to exclude them from comparison using a simple glob pattern by adding --exclude='*.sock'

– steeldriver
Jul 9 '16 at 14:21













Unfortunately, most of socket files in my system is not using *.sock extension (and I am not one that controls how filenames were selected) - for example all files in /var/lib/samba/private/msg.sock are composed from numbers and only from numbers.

– Mateusz Konieczny
Jul 9 '16 at 14:26





Unfortunately, most of socket files in my system is not using *.sock extension (and I am not one that controls how filenames were selected) - for example all files in /var/lib/samba/private/msg.sock are composed from numbers and only from numbers.

– Mateusz Konieczny
Jul 9 '16 at 14:26













Sorry, I misread (and didn't check on my own system) that the sockets are numerically named files within a directory called /var/lib/samba/private/msg.sock - I don't understand why you can't simply exclude the directory e.g. --exclude='msg.sock' or --exclude='*.sock'

– steeldriver
Jul 9 '16 at 15:12





Sorry, I misread (and didn't check on my own system) that the sockets are numerically named files within a directory called /var/lib/samba/private/msg.sock - I don't understand why you can't simply exclude the directory e.g. --exclude='msg.sock' or --exclude='*.sock'

– steeldriver
Jul 9 '16 at 15:12













@steeldriver Currently I am manually excluding directories, but I would prefer something less prone to failure and requiring less maintenance.

– Mateusz Konieczny
Jul 10 '16 at 18:04







@steeldriver Currently I am manually excluding directories, but I would prefer something less prone to failure and requiring less maintenance.

– Mateusz Konieczny
Jul 10 '16 at 18:04












0






active

oldest

votes












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f796688%2fexclude-socket-files-during-diff-r%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f796688%2fexclude-socket-files-during-diff-r%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How did Captain America manage to do this?

迪纳利

南乌拉尔铁路局