exclude socket files during diff -r
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
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
add a comment |
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
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
add a comment |
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
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
command-line diff sockets
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
add a comment |
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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