tar --exclude=âÂÂfilename.extensionâ not working combined with docker commands
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
So I first testing a simpler scenario I was able to correctly use the tar
--exclude
option, in the simple scenario, a folder, "pack" contains two files:
- text.txt
- mongod.lock
Screenshot of pack folder:
Running the command:
tar --exclude='mongod.lock' -cvf foo.tar -C /home/bogden/repos/devops/scripts/pack .
This correctly ignored a file named "mongod.lock" in the "pack" folder, created a tar named "foo.tar", that contained one file, tar verbose output:
The unpacking of the tar archive proves "mongod.lock" was ignored:
Now in my scenario I am archiving a docker container volume, and trying to exclude this "mongod.lock". The fact that this is a docker container volume does not matter that much except perhaps some kind of file path I need to include in my --exclude=
pattern.
docker run --rm --volumes-from example.db.container -v /backup/volumes:/backup centos7 tar --exclude='mongod.lock' -cvf /backup/backup.tar -C /data/db .
the mongod.lock is archived as well, it is not excluded:
I have also tried --exclude=
patterns:
- ./mongod.lock
- /mongod.lock
- **.lock
- /data/db/mongod.lock
I am guessing I have some folder path that I need to include in my ignore pattern but I am not sure
linux tar docker
add a comment |Â
up vote
0
down vote
favorite
So I first testing a simpler scenario I was able to correctly use the tar
--exclude
option, in the simple scenario, a folder, "pack" contains two files:
- text.txt
- mongod.lock
Screenshot of pack folder:
Running the command:
tar --exclude='mongod.lock' -cvf foo.tar -C /home/bogden/repos/devops/scripts/pack .
This correctly ignored a file named "mongod.lock" in the "pack" folder, created a tar named "foo.tar", that contained one file, tar verbose output:
The unpacking of the tar archive proves "mongod.lock" was ignored:
Now in my scenario I am archiving a docker container volume, and trying to exclude this "mongod.lock". The fact that this is a docker container volume does not matter that much except perhaps some kind of file path I need to include in my --exclude=
pattern.
docker run --rm --volumes-from example.db.container -v /backup/volumes:/backup centos7 tar --exclude='mongod.lock' -cvf /backup/backup.tar -C /data/db .
the mongod.lock is archived as well, it is not excluded:
I have also tried --exclude=
patterns:
- ./mongod.lock
- /mongod.lock
- **.lock
- /data/db/mongod.lock
I am guessing I have some folder path that I need to include in my ignore pattern but I am not sure
linux tar docker
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
So I first testing a simpler scenario I was able to correctly use the tar
--exclude
option, in the simple scenario, a folder, "pack" contains two files:
- text.txt
- mongod.lock
Screenshot of pack folder:
Running the command:
tar --exclude='mongod.lock' -cvf foo.tar -C /home/bogden/repos/devops/scripts/pack .
This correctly ignored a file named "mongod.lock" in the "pack" folder, created a tar named "foo.tar", that contained one file, tar verbose output:
The unpacking of the tar archive proves "mongod.lock" was ignored:
Now in my scenario I am archiving a docker container volume, and trying to exclude this "mongod.lock". The fact that this is a docker container volume does not matter that much except perhaps some kind of file path I need to include in my --exclude=
pattern.
docker run --rm --volumes-from example.db.container -v /backup/volumes:/backup centos7 tar --exclude='mongod.lock' -cvf /backup/backup.tar -C /data/db .
the mongod.lock is archived as well, it is not excluded:
I have also tried --exclude=
patterns:
- ./mongod.lock
- /mongod.lock
- **.lock
- /data/db/mongod.lock
I am guessing I have some folder path that I need to include in my ignore pattern but I am not sure
linux tar docker
So I first testing a simpler scenario I was able to correctly use the tar
--exclude
option, in the simple scenario, a folder, "pack" contains two files:
- text.txt
- mongod.lock
Screenshot of pack folder:
Running the command:
tar --exclude='mongod.lock' -cvf foo.tar -C /home/bogden/repos/devops/scripts/pack .
This correctly ignored a file named "mongod.lock" in the "pack" folder, created a tar named "foo.tar", that contained one file, tar verbose output:
The unpacking of the tar archive proves "mongod.lock" was ignored:
Now in my scenario I am archiving a docker container volume, and trying to exclude this "mongod.lock". The fact that this is a docker container volume does not matter that much except perhaps some kind of file path I need to include in my --exclude=
pattern.
docker run --rm --volumes-from example.db.container -v /backup/volumes:/backup centos7 tar --exclude='mongod.lock' -cvf /backup/backup.tar -C /data/db .
the mongod.lock is archived as well, it is not excluded:
I have also tried --exclude=
patterns:
- ./mongod.lock
- /mongod.lock
- **.lock
- /data/db/mongod.lock
I am guessing I have some folder path that I need to include in my ignore pattern but I am not sure
linux tar docker
asked Oct 20 '17 at 16:27
Brian Ogden
1014
1014
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f399384%2ftar-exclude-filename-extension-not-working-combined-with-docker-commands%23new-answer', 'question_page');
);
Post as a guest
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
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
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