Questions tagged [tar]

The tar archive format and/or the command-line utility for working with tar files.

Filter by
Sorted by
Tagged with
0
votes
1answer
1k views

Tar: File changed as we read it/ file removed before we read it Errors

I'm trying to create an automated backup script using the tar command: tar -czg /home/user/BackupArchiv/snapshots/snapshot_2020-10-12 -f /home/user/BackupArchiv/backup_2020-10-12/backupfull.tar.gz /...
0
votes
0answers
72 views

How to tell if piping a tar file as a stream to curl is streaming vs. saving to a cached file first?

I am trying to archive a folder using tar and then use curl to stream upload it without having to take up any space in my hard drive or memory. I have tar cf - "FOLDERNAME" | curl -v -T - \ ...
1
vote
1answer
97 views

Tar confusing error messages

I'm trying to create an automated backup file using the tar command. tar -czg /home/user/BackupArchiv/snapshots/snapshot_2020-10-09 -f /home/user/BackupArchiv/backup_2020-10-09/backupfull.tar.gz /home ...
1
vote
0answers
35 views

find out how many (posix) tar header blocks a file will require

Posix (pax) tar uses extended headers to allow long filenames etc.. Is there a way to find out how many 512 byte blocks will be used for the header for a particular file (before actually running the ...
0
votes
1answer
37 views

Tar command saves file in working directory instead of specified directory

I'm trying to make a automatic backup via the tar command: datum=$(date +%F) buweek=backup_$datum snap=snapshot_$datum mkdir /home/user/BackupArchiv/$buweek tar -czvg /home/user/BackupArchiv/...
1
vote
2answers
425 views

Checking if tar file exists | bash script

I am trying to test if the tar file I am about to create already exists. If it doesn't then I want to create the tar file (this part of the code works). However the if statement testing if that file ...
0
votes
1answer
54 views

Creating a tar file in a specified directory in a shell script

I am trying to create a tar file of an existing file or directory (file_dir_name) in a specified directory (dir_path). I need the tar file to be named new_name.tar in the new directory. However, when ...
10
votes
2answers
2k views

How portable is a gzip file over 4 GB in size?

To backup a snapshot of my work, I run a command like tar -czf work.tgz work to create a gzipped tar file, which I can then drop in cloud storage. However, I have just noticed that gzip has a 4 GB ...
3
votes
2answers
118 views

End of tape detection (ENOSPC) in tar multi-volume mode with pipes for encryption

Using tar in multi-volume mode relies on a ENOSPC error to detect the end of the first tape and prompt the user for the next tape. To simulate this behaviour consider the following example by writing ...
2
votes
1answer
38 views

Tarring up a a read-only partition

I'm new to Linux, and this is probably a silly question, but is there a way to set a partition to read-only and then tar up all the files on that partition and put them in a tar.gz on that partition? ...
0
votes
0answers
20 views

How to archive (tar) a folder and encrypt with gpg in one fell swoop without doing both separately?

I currently encrypt folders for upload to google by doing: First tar: tar cf foldername.tar /path/to/foldername and then gpg: gpg -c --cipher-algo AES256 -o foldername.tar.gpg foldername.tar I am ...
0
votes
1answer
45 views

What archival method (tar, zip, 7z, etc) allows me to retain folder modification dates on macOS?

I currently have a directory in a hard drive, say TopFolder which contains 3 subfolders, Folder1, Folder2, and Folder3. When I am in the top level directory of the hard drive, and do: tar cf TopFolder....
0
votes
1answer
28 views

Find tar archives not already existing as folders

I have a couple of tar archives, among them, some have the same filename as folders: folderA folderA.tar folderB.tar ... I want to be able to list/find all the tar files (ideally on the same/current ...
0
votes
1answer
18 views

Make Tar update existing archives only if present

So i have this one-liner i used: find . -maxdepth 1 -mindepth 1 -type d -exec tar cvf {}.tar {} --remove-files \; Where it tar each top directory into their own tar archive, while deleting files ...
0
votes
0answers
207 views

Getting “tar: Exiting with failure status due to previous errors” while trying to compress a directory

I'm trying to compress a directory but getting this error tar: Exiting with failure status due to previous errors I'm using centos 7 on aws instance and here is the commands I've tried tar cvzf hmd....
1
vote
1answer
76 views

I have extracted a tar file in the wrong directory

I have extracted a tar file in the wrong directory, and this tar file extracted 200 files. I cannot remove everything from the directory because there are 10 files that are sitting in the directory, ...
2
votes
3answers
2k views

How to use multi-threading for creating and extracting tar.xz

I use tar -cJvf resultfile.tar.xz files_to_compress to create tar.xz and tar -xzvf resultfile.tar.xz to extract the archive in current directory. How to use multi threading in both cases? I don't ...
2
votes
1answer
185 views

How do you determine the remaning capacity of a magnetic tape with mt or tar? How much space is in a block?

I am currently trying to back up data onto an LTO-4 tape using mt-st and gnu tar 1.32, but I want to make sure I stop trying to copy things before the tape runs out! LTO-4 nominally has a capacity of ...
0
votes
0answers
49 views

Linux bash script (creating tar.gz multiple files)

I need to create a script which create .tar.gz files called same_numbers_$i. Eeach tar.gz need to contain all the files of the directory started with the same number using loop for to 1 >40. I ...
0
votes
1answer
38 views

Delete directories after compressing with tar

I´m trying to compress a whole directory tree, leaving just one .tar.bz2 file instead of each directory that I found with find. The purpose is to create a cronjob for doing this in weekly basis. The ...
0
votes
1answer
885 views

Installing DHCPD on Arch Linux

I've installed Arch Linux today and am a bit of a noob at using it, so when I had done the installation my system would connect too my network fine, but after rebooting it stopped and gave me an error ...
0
votes
1answer
88 views

How to extract a compressed tar using cpio to a particular directory location

I created the compressed tar file using the below command. find /app/jboss -not -name "*.err" -not -name "*.log" | cpio -o | gzip >/app/patchbkp/test/REDHAT_jboss-eap-7.2_18-Aug-...
2
votes
2answers
59 views

Create tar file that stores filenames, but not file contents

Basically I want to create a tar image of a folder structure, but not store the actual file contents. So when I untar the file I want to get the original folders, filenames, timestamps, etc.., but all ...
0
votes
0answers
73 views

Why is tar creating file size 10240 and how to export exact part of file name to variable?

I'm using wget to recursively fetch directories filed with files. There are many folders and files in it. I'm downloading all directories recursively too. Sometime-somehow wget "stuck" and ...
0
votes
1answer
58 views

Tar multiple files in a custom way?

I faced a problem of building a tarball for my application manually to prepare a distribution. My project structure looks as project_root | |__resources | |____config.conf | ...
3
votes
1answer
399 views

File ownership preservation with .tgz

Back with another probably very very basic UNIX question. I understand the premise of Tape Archive Zips (.tgz) is that they preserve uid, gid, permissions... However, it seems that this isn't portable....
2
votes
2answers
75 views

Why tar uses absolute path even though I have changed to dir via -C?

Having this: $ls $des/bin a.c analysis.hpp classify.hpp main.cpp split.hpp a.cpp a.out grade.cpp main.out student.cpp analysis.cpp classify.cpp grade.hpp ...
2
votes
2answers
2k views

How to tar only specified files via wildcard?

I would like to tar only specified files. I have tried: $ ls $des/bin a.c analysis.hpp classify.hpp main.cpp split.hpp a.cpp a.out grade.cpp main.out student.cpp ...
-1
votes
2answers
533 views

How do i split my tar.gz into multiple files in a single exec command? [duplicate]

I don't know anything about Unix/Linux. I am primarily a web programmer. I am running the following command in my code: exec("tar -caf '/backups/_structure.tar.gz' --ignore-failed-read -C /source ...
-2
votes
1answer
89 views

Need solution to archive a folder excluding all .log and .err files using wildcards

I wish to archive all files and folders under /app/jboss while excluding all .log and .err files. The directory structure under /app/jboss is too vast and complex. Thus a few sample files below should ...
2
votes
1answer
241 views

Tar incremental backups - skip restoring deleted files

To restore an incremental backup we need to first restore the full backup then the incrementals in the same order then deleted files are removed. It is useless to restore files then delete them and ...
0
votes
1answer
97 views

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 ...
0
votes
1answer
64 views

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=...
0
votes
1answer
54 views

Why won't tar/gzip compress two similar large directories?

A long time ago, before I tried incremental and differential backups, I tried to tar/gzip several similar large (1 GB) directories, but they did not compress any better than tarring and gzipping each ...
3
votes
1answer
184 views

broken pipe when tar extracted from stdin buffer

I am restoring files from a tar archive on an LTO-7 tape to a locally mounted network share. If I directly restore to the share it runs very slowly (90 MB/s). When I use an additional buffer I get the ...
6
votes
2answers
325 views

Modify file names in tar file without extracting files to temporary location

I have a tar file that contains some files in a folder named old_name. Now I'd like to create a new tar file where that folder has been renamed to new_name without extracting to file to disk as that ...
-5
votes
1answer
61 views

How to unpack *.tar.gz

I have used the command tar zxvf filename.tar.gz ...to try to unpack the file. However, upon entering the command the screen just fills with x hadoop-3.1.1/share/doc/hadoop/hadoop-client-runtime/...
-4
votes
1answer
374 views

tar refuses to write archive contents to terminal

I'm trying to install linux on my computer and it was going smoothly until I put in this command curl https://chrx.org/ | sudo tar xzfc - /usr/local && chrx tar: You may not specify more than ...
0
votes
1answer
83 views

difference between two tar commands

i want to tar the contents inside /some/directory/ and this directory has lots of files and other sub directories in it. what is the actual difference between the below tar commands, i noticed the ...
0
votes
1answer
31 views

tar: don't create “.” directory

I'm creating a .tar.xz archive like this: XZ_DEFAULTS="T$(nproc)" tar cvfJ "$archive" -C "$dir" . It's creating this useless . directory when I try to open the archive: ...
0
votes
0answers
28 views

Get data from corrupt lz4 tar archive

I have a tar, that somehow got corrupt. I very much need some certs and config files I backed up using said file. Problem is, there's a corrupt folder in the archive and tar bails after hitting it. Is ...
0
votes
0answers
103 views

How to tar all files and directories except one?

I want to zip a directories and its files. For that I want to use tar. This directory contains a sub-directory called ignore which should not be included in the zipped file. How can I use tar to zip ...
1
vote
1answer
31 views

search and tar files respecting folder structure?

I'd like to search for all csv files in a few "date" subfolders, and then tar them preserving that structure, since the date is only at the level of folder, not file. So, for example I have ...
2
votes
1answer
108 views

Write tar archive to tape and then extract individual files

I would like to write a tar archive to tape, and at the same time store the block offsets for each file in a lookup table. Then when I want to restore an individual file from the archive, I would seek ...
1
vote
1answer
29 views

Can I write the same tar archive to two tapes at once?

Is it possible to simultaneously write a tar archive to two tape drives using a single command, by directing the same output to both drives? I want to save time by performing the operation in ...
0
votes
1answer
45 views

What happens when I create a file in the directory that is being archived with tar?

I have a large directory (80GB) that I want to compress into the archive. What happens, when a new file is created in that directory, while it is being tared? Would new files be included in the ...
0
votes
1answer
53 views

Use disk like tape

We are building a data archiving system where we want to have the option to store redundant copies of data on different storage types: tape/disk/cloud, and also with the option of using different ...
1
vote
1answer
102 views

Rsyncing directory to a backup gzip file

Objective: The efficient backup and transfer of ~/dircontaininginnumeraltinyfiles/ to /mnt/server/backups/dir.tgz. My first thought was of course rsync and gzip. But I'm open to other routes as well. ...
4
votes
2answers
175 views

How do I write sequentially several tar's to a tape?

I am trying to write several directories to a tape. Each directory with one tar command. So I have the following sample file/directory structure: user@host1:~/temp/original % find . . ./foo1 ./foo1/...
0
votes
0answers
48 views

How can I know how many files are stored in a tape?

I have installed an SCSI DDS4 tape drive and I have read: https://www.freebsd.org/doc/el_GR.ISO8859-7/books/handbook/backups-tapebackups.html and https://docs.freebsd.org/doc/2.1.5-RELEASE/usr/...

1
2
3 4 5
22