Questions tagged [tar]

GNU tar creates and manipulates archives which are actually collections of many other files; the program provides users with an organized and systematic method for controlling a large amount of data.

Filter by
Sorted by
Tagged with
1 vote
2 answers
1k views

How to untar a single file from an archive with randomly generated directory names?

I'm trying write a script that will download a tarball from github and extract a single file from it. However the top level directory inside the tarball has some random characters in it, which I ...
1 vote
2 answers
3k views

Untar selected files in .tar.gz file from remote ftp server?

Lets say i have a big backup.tar.gz file in a remote ftp server. I needed some files from it but i dont want to download/untar all of it. Just specific files/folder. normally this is code to select ...
-5 votes
3 answers
2k views

Any reason for «tar: Can't specify both -x and -t»? [closed]

Question is due curiosity mostly… — it's kinda strange and awkward limitation considering tar's inability to list content w/o reading the whole (sometimes huge) file.
0 votes
1 answer
442 views

tar from tape never finds directory I want

I'm a newbie when it comes to working with tape backups. I'm trying to extract a directory from a tape archive, and not getting much success. The directory on the tape is of the format /foo1/foo2/...
0 votes
1 answer
1k views

Make rsync working with compressed target or tar creating no increment files

I need to make a backup on my external hard drive. I looked both at rsync and incremental tar. The problem is that I want my backup to be compressed. With rsync I can only compress the data transfer, ...
2 votes
1 answer
115 views

Linux - Splitting a backup into two steps

I create a tarball using tar zcf arhive.tar.gz dir/ and this works ok. Now I wanted to split this into two simple archives, one only for images, the other -- for everything else. It seems that there'...
0 votes
2 answers
855 views

How can I make monthly backups (with dated file names) using Cron on Debian?

I'm having trouble adding the date to the backup file's filename. Here's the Cron command (for testing): */2 * * * tar -zcf /var/backups/www-(back tick)date +%Y%m%d(back tick).tgz /var/www/ It should ...
5 votes
7 answers
3k views

fastest backup for large files

what is the fastest way to duplicate a folder contain few files with few hundred megs size and other few megs small files? (say, /var/lib/mysql) cp or tar or rsync or...??
4 votes
2 answers
2k views

tar specific number of file

I have a directory with 27K files, I would like to tar them into multiple INDEPENDENT tar files, each will have 5000 files and the last one, will obviously have 2K (27K is not dividable by 5). What ...
2 votes
1 answer
187 views

How to remove a certain folder when tar zipping?

I want to remove a folder when I'm creating a tar.gz file as it's for a backup and it takes too much space and is not required I am using the following command; tar -cvzf /home/backups/$STAMP-Earth....
0 votes
1 answer
583 views

Use tar to exclude one directory (but not another) that matches a pattern

I'm working on doing a pretty straightforward tar for a site, but there's a wrinkle. Here's the file structure of the site: ... files/ images/ images/visitors/ ... logs/ ... visitors/ ...
3 votes
4 answers
15k views

How to list the files on a tape with tar?

On a HP-UX OS I have a backup on a magnetic tape created from the SAM. Everywhere I read the instructions to list-verify the contents of the tape is to use the TAR program: #tar tvf /dev/rmt/[...
18 votes
2 answers
16k views

How to tarball a directory without carrying over /path/to/folder?

Example command: $ tar -cvjf destination.tar.bz2 /path/to/folder/source I'd like the final destination.tar.bz2, when extracted, to not include a /path/to/folder/ file directory. It seems inefficient ...
1 vote
2 answers
1k views

tar to tape and file with encryption

I am trying to encrypt our tape backups, using tar and openssl but also write to a local file, so far I have : tar --total -czp ./tmp ./home | tee /tmp/Archive.tar.gz | tee > /dev/nst0 I'm not ...
4 votes
1 answer
2k views

Does tarring up small files into one big tar file before writing them to tape increase the level of data loss when an error occurs?

I've been looking at our backups recently and noticed that the tape throughput is a lot lower when writing lots of small files, so was thinking of tarring those small files up into one big tar file ...
0 votes
3 answers
4k views

zip does not work for big files

What is the best way to compress a file if it is more than 4 GB in size? I am using the following for last several months. mysqldump --all-databases | zip > mybackup.zip Today I am got an error: ...
5 votes
2 answers
6k views

tricks for speeding up tar while tarring up a huge directory of little files?

I'm trying to tar up a directory that has about 3M tiny files in it. Tar is chugging along, but I'm thinking its going to take longer than I can wait. I'm wondering if telling tar to not store ...
1 vote
1 answer
904 views

Why does tar -c dir | pigz > /mnt/nfs/dir.tgz use network, then cpu in cycles instead of both at once (with one bottlenecking)

I want to transfer a multi-terabyte directory to an nfs mounted directory most efficiently over a 1Gbit network (probably the limiting factor) 3 options - tar and compress in place, then copy copy, ...
3 votes
1 answer
362 views

verify integrity of encrypted tar

I'm using tar along with openssl to create encrypted tar archives of some large directories (about 30GB). What is the possibility of corruption in this process, and how would I verify that the ...
1 vote
1 answer
127 views

Tar: create new archive from filtered archive

I need to create a new tar archive from the filtered output of the original. I thought something like this might work: tar xvpf myarchive.tar --exclude=foo* | tar cvpf mynewarchive.tar but that ...
2 votes
3 answers
595 views

Bandwidth-friendly backup strategy using tar?

We've used tar to backup and compress (gzip) selected directories on our file server with very good results until recently. Each and every one of our backups are stored on mirrored (RAID) harddrives ...
0 votes
1 answer
130 views

TAR + create the dir under specific location

I must to run the tar command only under /var/tmp in my Linux machine ( red-hat linux ) so I run the tar command. And directory "KIT" created under /var/tmp in place under /var/tmp/DIR/ What to ...
5 votes
2 answers
3k views

CentOS 5.6 Update Version Of Tar

I am running CentOS 5.6 and for some ungodly reason, the version of tar is from 2004, and not compatible with the node package manager (NPM). How in the world can I update it? Is there an additional ...
0 votes
2 answers
497 views

CRC Failed, File is broken, using php system command to tar a directory

Can anybody see a problem with the below PHP code? Or have any ideas to troubleshoot a solution as to why whenever I download the backup file.tar.gz and try to open it using 7zip on windows... that I ...
1 vote
1 answer
470 views

update tar archive in the relative directory

when I want to create a tar archive in a relative path, I can do this: tar cf archiveName.tar -C relative/path someDirectory but when I want to update the archive, this tar uf archiveName.tar -C ...
1 vote
2 answers
1k views

Quick and Easy Backup of Remote Server?

I'm switching from a slower remote server to a faster one. (In a nutshell.) Everything seems to have been migrated properly, but just incase some things didn't get transferred properly, I'd like to ...
0 votes
1 answer
699 views

Update default tar location (CENTOS) [closed]

Im not a linux admin by far but ive been playing with node lately... a package im trying to use wasnt happy with b/c tar and i found i was running tar (GNU tar) 1.15.1 i downloaded the new version to ...
0 votes
2 answers
1k views

Mail backup error (tar Cannot stat: No such file or directory)

I have got this error in during my mail server backup: 2010-09-16 06:24:20 ERROR backup of /var/mail/vhosts failed: tar: Removing leading `/' from member names tar: /var/mail/vhosts/host-name/0/user-...
7 votes
2 answers
1k views

Can I throttle tar without ionice?

My tar command tar --remove-files -cvif 2011-08-02_14-05-09.tar 2011-08-02_14-05-09 Writes 80MB/s. That's beyond the capacity we can spare because MySQL starts queuing up writes and eventually we ...
1 vote
2 answers
1k views

Compress streaming data before sending

The following is working as expected. Sending server: mysqldump db_name tbl_name -d | nc -l 1234 Receiving server: nc 10.10.10.114 1234 | mysql -uroot -proot@123 test When I am dumping to remote ...
0 votes
2 answers
108 views

Compressing directories on server without ssh

Is there a way to compress directories on a server without ssh access? We are transferring many domains and there is no ssh available on the current server. We would like to secure copy the ...
0 votes
3 answers
182 views

Uncompressing gzip file

I have compressed a folder using following command: tar czvf arch.tar.gz dirname/ When I try to uncompress it using following command tar xvfz arch.tar.gz then it uncompress folder but contents of ...
0 votes
1 answer
615 views

Can I extract a file or directory using the tar command and provide it a specific name I want it extracted as? [duplicate]

Possible Duplicate: Can I extract a specific folder using tar to another folder? I am new to world of Linux and would like to know if I can extract a specific file or directory by giving it a new ...
1 vote
2 answers
5k views

What happens if you use the command tar tvf as opposed to tar tvfz?

I am new to the world of Linux and in the process of setting up a Linux environment. I stumbled across the tar command as I need to view the contents of a file prior to extracting it and by accident ...
1 vote
2 answers
174 views

MySQL needed to download in order to compile from source?

I have Slackware 13.1 and due to some bugs on the current version of the MySQL it comes with, I have to upgrade it. Since Slackware does not have 5.5 and I am upgrading I have decided to go with 5.5.x....
0 votes
2 answers
899 views

tar too slow when file doesn't exist!

I have a gigantic list of files on a text files. This list is passed to tar, like this: cat list.txt | xargs tar rvf archive.tar --ignore-failed-read The problem is that some files that are on the ...
2 votes
1 answer
339 views

Cronjob - Godaddy

I'm trying to create a backup from Godaddy's shared hosting envinronment for a friend. The sites entire file is about 2GB, and Godaddy doesn't support archiving files more than 20MB. The only option ...
0 votes
1 answer
356 views

Backup to Tape using tar: How to add file details (time, date, size) to a TAR log?

What is the best way to make my tar log more informative? Cat'ing the log shows what was backed up, but tells nothing about the files last update or size. Eg: tar cvf /dev/st0 foo* > backup.log ...
6 votes
3 answers
383 views

Returning A List Of Quoted Files Paths Using Find

I would like to create a tarball that contains files from a directory that have a ctime of less than 30 days. Most tutorials I have found have basically recommended doing something like this: tar cvf ...
2 votes
1 answer
2k views

Tar "mode" flag is being ignored

I try to tar a file and set the permissions to 666 using the mode flag. But whatever permission I set, it is simply being ignored. Command: tar xvzf backup.tar.gz --mode=666 -C /home/user/ Till ...
2 votes
1 answer
3k views

Create ZIP archive without storing permissions?

I am distributing packaged files in ZIP format. I use the following to create: zip -r distr.zip files/ When expanded on other UNIX system files preserve their permissions as they were when I packed ...
2 votes
2 answers
4k views

Linux how to move a large file?

I had an ISO file that was over 4GB. When I tried to copy or move the file from my computer to a USB key, I remember getting some error about the file being too large for the operating system to ...
1 vote
2 answers
395 views

Linux: How do I archive select file extensions in an unknown tree

What is the best way to archive select file extensions in an unknown tree. I cannot use exclude options in tar/gzip/rsync as it would be impossible to exclude all possible extension variations. ...
0 votes
1 answer
1k views

Python script take long time to backup folder

I copied this script from some book to make tar.bz2 of some folders for backup. #!/usr/bin/env python import tarfile, os def make_tar(folder_to_backup, dest_folder, compression='bz2'): if ...
14 votes
1 answer
11k views

How to show numerical UIDs/GIDs stored in tar file

I've got some troubles with a tar file that holds a backup. It was provided by our hosting provider and contains some strange file permissions. When viewing with tar tvf example.tar I only get the ...
0 votes
1 answer
698 views

Using tar on SLES Linux

I am trying to install some package from these instructions: http://www.franz.com/agraph/support/documentation/v4/server-installation.html#header3-25 I run this command: tar zxf agraph-4.2-...
0 votes
2 answers
269 views

script - extract multiple files

I have 30 tgz files like these: live-3.0.10-20101031.tgz live-3.0.4-20101005.tgz when I extract them it will be extract in to "live" folder.(ie: tar xvzf live-3.0.10-20101031.tgz will extract to "...
1 vote
1 answer
2k views

Change only a specific owner when extracting tar archive

I have a tar archive containing two owners, 1000 and 0 : $ tar tfvz archive.tgz drwxr-xr-x 1000/1000 main/ drwxr-xr-x 0/0 main/root_dir/ drwxr-xr-x 0/0 main/...
1 vote
1 answer
363 views

gzipped tar archive file paths

I am creating a tar.gz file containing some files and folders as follows: /bin/tar cfz /usr/local/backups/mybackup-${DATENAME}.tar.gz /usr/local/backups/db-${DATENAME}.sql.gz ...
0 votes
2 answers
5k views

Differential backup with TAR relative to specific weekday

I want to have the following backup cycle on Debian Lenny: Monday : Full backup Tuesday : Differential backup relative to Monday Wednesday: Differential backup relative to Monday Thursday : ...

1
3 4 5
6
7