Does the tar
command have an option to skip/ignore tar-ing the already tar-ed files?
consider I had a file1.txt
and it's tar-ed as file1.tar.gz
, now I copied another copy of file1.txt
and a lot of other files like file2.txt
, file3.txt
, etc
what I expect, when tar-ing all these files, don't tar file1.txt
again; I'm not interested in excluding all *.tar.gz
files since it doesn't telling tar
command to don't pick file1.txt
to tar.
What I need actually prevent file1.txt
to pick by tar
command to do tar it as file1.tar.gz
again which that's exist before (right now its overwriting).
Note: I could write a script, but I want to make sure, tar
command cannot do this.
tar cvf /storage/someFiles.tar $(find /sourceDir | grep -v '.tar')
. Not sure the syntax is correct, but I trust you get the idea.mv file1.txt file1.txt
does for example. so when you do something liketar -czf file1.tar.gz file1.txt
and again and again trying to do the sametar -czf file1.tar.gz file1.txt
, I wantedtar
to knows that there isfile1.tar.gz
already why it bother itself to tar it again. idea is coming from where I wanted to tar a very big file and every time it will try to tar and tar and tar again --->mv file1.txt file1.txt
does, it do it within it's own invocation / session. What you wan't to do with tar are over multiple invocations.