Questions tagged [gnu-tar]

gnu-tar is the implemented by Gnu of the tar command, it is the default tar on many Linux systems, but no on BSD & OSX. It has several extensions not found in other tars. Use this tag if you have a gnu-tar specific question. Otherwise, or if you don't know, use the more generic [tar]

Gnu tar

15 questions
17
votes
2 answers

Anonymous tarballs

Tar encodes my user name into the tarball. Can I force it to make a fully anonymous tarball? --owner root replaces only some instances of my user name. Adding USER=root: USER=root tar c --owner root data has no effect. In short, I wish for: echo…
Petr Skocik
  • 28,176
  • 14
  • 81
  • 141
4
votes
2 answers

GNU tar not ignoring directories in gitignore with --exclude-vcs-ignores

I have a git repo: rsh: ❯ cat rsh/.gitignore *.o shell build/ rsh_history And I'm attempting to tar it up using tar (GNU tar) 1.32. The command I'm using is: ❯ gtar cvaf rsh.tar.gz --exclude-vcs-ignores --exclude-vcs rsh Unfortunately, the build/…
xrisk
  • 691
  • 6
  • 8
2
votes
1 answer

Unable to exclude directories while using tar

I have a folder in Home directory with the following structure: top-tree +-- .git +-- branch1 | +-- branch11 | +-- .idea | +-- branch111 | +-- branch112 | +-- branch113 | +-- branch114 | +-- branch1141 …
skrowten_hermit
  • 731
  • 3
  • 13
  • 32
1
vote
1 answer

Is it safe to delete GNUSparseFile.0 directory?

While looking through some filesystems to see what consumes disk space I found out a directory called GNUSparseFile.0. I can't easily find out if its contents are used. Can it be some temporary leftover from untarring? The OS is FreeBSD so it may…
filo
  • 183
  • 1
  • 7
1
vote
0 answers

GNU tar: How to mix include and exclude on when --listed-incremental is in effect?

I have a tar command where I need to mix "include" and "exclude" operations. This is - when not using --listed-incremental working perfectly, but not when combined with --listed-incremental: What I have tried: Setup test scenario /tmp/tartest$ rm *…
AnoE
  • 565
  • 1
  • 3
  • 11
1
vote
1 answer

Make tar on multiple predefined tapes

How do I tar some files to multiple tapes, with each tape being listed in advance? This way I can have a fully-unattended archival, with no need to physically change media once a tape is full. In my specific case, Each tape is actually a /dev/sd?…
Alexander M
  • 111
  • 4
1
vote
0 answers

Stripping and Renaming parent directory for each line output in tar -T -?

I have an list of directory output from the following command that I want to tar: find ./temp -type f -name '*' ./temp/main/randomfile.txt ./temp/main/dir_a/random.txt ./temp/main/dir_b/random.txt ./temp/main/dir_c/random.txt Then I pipe the…
vcoder_12
  • 11
  • 1
1
vote
1 answer

tar exclude not working as expected

I am trying to create a .tar file of the filesystem but exclude the /proc directory. The command I have tried is: tar -czvf mytar.tgz / --exclude='/proc' But this does not exclude the directory. I have also tried it without the single quotes. # tar…
Proletariat
  • 669
  • 3
  • 16
  • 28
0
votes
2 answers

Extract archive with BSD tar to directory with same basename

GNU tar allows to extract the contents of an archive to a directory named after the basename of the archive. $ touch foobar $ gnutar czf archive.tar.gz foobar $ gnutar --one-top-level -xf archive.tar.gz $ ls archive/foobar archive/foobar I can get…
0
votes
1 answer

Is it possible to remove the already unpacked files from .tar?

I have a .tar file which takes up about 70% of my disk space and I would need to unpack it to the same disk. Does the tar command have an option to remove the files that have already been unpacked during the process so that they don't take up the…
Botond
  • 135
  • 5
0
votes
1 answer

GNU tar's "transform" option behaves inconsistently when pattern ends in "/"

I have come across the following strange behavior of GNU tar when using the --transform option to transform path elements: When I try to tar an entire sub-directory and want to transform the path to this directory, the transformation is not applied…
AdminBee
  • 21,637
  • 21
  • 47
  • 71
0
votes
1 answer

tar exclude certain directories but not in subdirectories

I need to transfer a lot of web directories to another machine. The directory structure looks like this: /var/www/ site1/ cgi-bin/ ... logs/ ... index.html images/ ... ... site2/ cgi-bin/ …
ygoe
  • 223
  • 2
  • 12
0
votes
3 answers

Tar exclude parameter in bash script not working

I got a tar command line that works great straight in the shell. tar --exclude=out/pictures/\*.{jpg,gif,png,jpeg} --exclude=tmp/\*.{txt,php} --exclude=log/\*.{log,sql} -cvf /backups/mydomain.tar -C /var/www/vhosts/mydomain.com/httpdocs content As…
Kuba
  • 1
  • 3
0
votes
1 answer

Does GNU tar incremental backup save an entire file again, even if only atime or mtime is different?

mkdir test echo "hi" > test/file1 tar -c -f archive.0.tar -g test.snar test touch -a test/file1 # changes atime and ctime, doesn't change mtime tar -c -f archive.1.tar -g test.snar test tar -t -G -vv -f archive.1.tar # lists Y for file1 So did…
qwr
  • 647
  • 7
  • 11
0
votes
1 answer

Can GNU tar incremental backup use checksums?

According to GNU tar manual: Incremental dumps depend crucially on time stamps, so the results are unreliable if you modify a file's time stamps during dumping (e.g., with the `--atime-preserve=replace' option), or if you set the clock…
qwr
  • 647
  • 7
  • 11