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.

learn more… | top users | synonyms

37
votes
7answers
36k views

mysqldump to a tar.gz

Usually after dumping a MySQL database with mysqldump command I immediately tar/gzip the resultant file. I'm looking for a way to do this in one command: So from this: mysqldump dbname -u root -p ...
32
votes
1answer
2k views

Why does `tar -xvfz` fail, but `tar xvfz` work?

tar -xvfz foo.tar.gz returns an error tar: z: Cannot open: No such file or directory This is completely understandable - the f switch expects a filename, and so needs to be last. However, omitting ...
20
votes
8answers
9k views

Quickest way to transfer 55GB of images to new server

I currently have two CentOS servers. I need to know how and what the quickest way would be to "tar" up the images directory and SCP it over? Is that the quickest way that I just suggested, because ...
11
votes
2answers
24k views

Can I extract a specific folder using tar to another folder?

I am new to the world of Linux and seem to have run into a stumbling block. I know I can extract a specifc archive using the command tar xvfz archivename.tar.gz sampledir/ however how can I extract ...
10
votes
2answers
4k views

Fastest way to extract tar.gz

Is there anyway to extract a tar.gz file faster than tar -zxvf filenamehere? We have large files, and trying to optimize the operation.
9
votes
4answers
4k views

Does tar preserve permissions if user IDs change?

I need to backup some data with the "p" option on tar command. The problem is the place I'm going to restore this data will have all the same users, but those users may have different IDs. Does that ...
9
votes
4answers
3k views

Linux: How to break a large file into smaller files?

I have a giant file (>20 gigs) sitting on my source machine and I need to transfer it to my target machine. For the purposes of this question, let's assume that I do not have network connectivity ...
8
votes
2answers
555 views

Transfer a 30GB tar file from one remote server to another - restrained by disk space

I have a 38GB "Moodle" tar file that I need to transfer from the old server (Shared hosting), which we can call "Server A" to the new server (Dedicated virtual), or "Server B". I'm with Mediatemple if ...
7
votes
9answers
1k views

Copy 10 million images in a single folder to another server

Now I know you shouldn't ever put 10 million files into a single directory to begin with. Blame it on the developers, but as it stands that’s where I am at. We will be fixing it and moving them into ...
7
votes
3answers
7k views

How to perform a secure rsync between servers across an unsecured network

Basically what I'm asking is, has anyone come across a means by which to wrap rsync inside ssh. With OpenSSH v4.9+ sftp has some nice options that allow you to chroot the incoming connection and such ...
7
votes
2answers
488 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 ...
6
votes
3answers
4k views

Un-tar a specific directory inside of a tar

I have the Wordpress tar, latest.tar.gz. Within it is the following structure /wordpress/dirtories/files When I do the following command I would prefer if I could have it unpack starting at ...
6
votes
2answers
4k views

Mount a tar file - not possible?

It seems one cannot mount a tar file (read only), similarly as one mounts an ISO image file. At least, I have not found any implementation. It would be useful, for example to run a find command ...
5
votes
2answers
278 views

tar file modified bit (am I being BS'd to?)

I'm working on a project where I'll be using tar to incrementally backup data on a server to a number of tapes. According to a senior co-worker of mine, tar will "set special flags on files so that ...
5
votes
3answers
3k views

Determine if file is in the process of being written upon?

I need to deploy an automated process (via 1 min cron script) that looks for tar files in a specific directory. If a tar file is found, it is untarred to the appropriate location and then the tar file ...
5
votes
5answers
3k views

“Stream” tar action from remote server through Putty?

I am accessing a shared hosting account through Putty / SSH. The account is pretty full, 300 MB below its quota. I need to make a full backup of all data present on the account. Creating a bzip2 file ...
5
votes
3answers
117 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 ...
5
votes
7answers
1k 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...??
5
votes
3answers
490 views

Linux tar archive without parent structure

I'm trying to modify a certain tar.gz archive I have. When I go to create the tar, it retains the parent directory structure, as a tarball should. However, is there a way to simply create a tar ...
5
votes
1answer
978 views

tar padding with zeros

When performing a tar on a bz2 compressed file I am encountering the following error, tar: dump.sql: File shrank by 19573448400 bytes; padding with zeros Can anyone point what might be causing this ...
5
votes
7answers
1k views

running tar completely locks up mysql

I am having a seriously weird issue. If I tar some random directory with many files or a single large file tar -pcvf files.tar /var/log, mysql gets completely locked up and all mysql connections get ...
4
votes
2answers
1k views

Compress every file in a directory into its own compressed file

How do I compress every file in a directory into its own tar whilst preserving the name for each file? i.e. file1.out file2.out --> file1.out.tar.gz file2.out.tar.gz
4
votes
7answers
2k views

Is there a smarter tar or cpio out there for efficiently retrieving a file stored in the archive?

I am using tar to archive a group of very large (multi-GB) bz2 files. If I use tar -tf file.tar to list the files within the archive, this takes a very long time to complete (~10-15 minutes). ...
4
votes
1answer
263 views

Ran out of disk space, how to tar without creating copy

I am at 98% of an 8GB SSD, and I have a 3 GB mysql data that I need to gzip and or tar and then download it, so then I can delete it. How can I tar or gzip the sql (or the mysql tables) so that that ...
4
votes
2answers
444 views

tar and ssh large file

I have running the following command for 5 hours and still going. mysql has gigabytes of data, but how can I make sure that the following command is actually transferring data. Can someone check the ...
4
votes
4answers
308 views

Ultrium 3 tape drive shoe-shining, 3Mb/s: and it's not the cable

I have a HP 960 Ultrium 3 tape drive. Since I got it, (second hand, £90) I've been experiencing shoe-shining. Writing with tar in Linux, I average about 3Mb/s write speed. I've tried replacing both ...
4
votes
3answers
2k views

How to list content from a tar file without recursion?

I've a tar (gz, bzip) file and want to see its content, but not recursively. This is: The "first level" in the file. I already know how to see content: tar -ztf file.tar.gz But it's recursive!! ...
4
votes
1answer
3k views

compare tar content with local folder

I want to compare the content of a tar archive (backup of $HOME) with the content of my local $HOME to see whether there are files in the tar file which are not yet in the local filesystem. What is ...
4
votes
3answers
2k views

How to convert a TAR file into an ISO file

I have a Linux TAR file that I would like to convert directly into an ISO. Is there a way to do this, preferably, without having to extract the contents of the file first? This would be similar to ...
4
votes
1answer
95 views

Is it really impossible to prepend data to a tape?

I would like to keep a log of files that I am writing to tape using dd or tar for each file. Then at the end of the run, prepend that log to the beginning of the tape using dd. If it works, I can see ...
4
votes
4answers
372 views

Corrupt tar (Resulting folder smaller than packed file)

I have an issue with a tarball created on a SuSe 10.3 Server version. The .tar file has a size of 6.5 GB but if I untar it under Ubuntu 9.10 the resulting folder only has a size of 1.5 GB. commands ...
4
votes
2answers
829 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 ...
3
votes
4answers
316 views

taring vmdk files does not preserve thinness

we have NFS storage, where we store our backups.. we manipulate with them from linux machine where the nfs is also mounted.. So, for example thin provisioned thin.vmdk disk is on linux seen as ...
3
votes
2answers
4k views

How do you only tar files in a directory based on a specific file name?

I want to create a tar ball and include only the files in the directory that start with a specific filename. For instance I have apples-x.x.x and oranges-x.x.x, and I only want to tar the files ...
3
votes
3answers
627 views

Why does “tar -cSf file.tar source” run out of memory?

I'm trying to back up 66 gigabytes to a NAS by making a tarball, but "tar -cSf ..." quits with a "memory exhausted" error after gigabyte 62. My Linux machine has a gigabyte of RAM and a gigabyte of ...
3
votes
2answers
304 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 ...
3
votes
2answers
261 views

Is it safe to zip/tar hotcopied svn repositories?

We want to store our backups of our svn repositories as a flat file. We'd like to tar/zip the whole hotcopied directory. I know that we could dump it to a flat file but let's pretend that we'd rather ...
3
votes
2answers
316 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 ...
3
votes
2answers
2k views

Can “tar” backup incrementally?

I have my home folder with a few GB. Is it possible to run tar on it, create a home.tar.gz, and then for changed files, it creates home1.tar.gz only with modified files from previous tar (thus being ...
3
votes
2answers
2k views

Linux command line - search a file inside a tar archive

I would like to check whether a file is in a gzip'ed tar archive. For example I want to check whether the /etc/passwd is present in the archive backup_2010-09-27.tar.gz A dumb solution can be: tar ...
3
votes
1answer
133 views

Can I get tar to not use the filesystem cache when reading files?

We have a cronned job on a production web server that requires tarring up files from across the filesystem. It runs for about 105 minutes, and during that time, Apache starts swapping because all ...
3
votes
4answers
3k 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 ...
3
votes
1answer
190 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 ...
3
votes
3answers
1k views

cpio VS tar and cp

I just learned that cpio has three modes: copy-out, copy-in and pass-through. I was wondering what are the advantages and disadvantages of cpio under copy-out and copy-in modes over tar. When is it ...
3
votes
4answers
1k views

Cannot set target directory when extracting an archive using tar

I'm trying to extract a tar archive to a specific directory. I've tried using -C flag but it doesn't work as expected. Here is the commandline I'm using tar xvf myarchive.tar -C mydirectory/ This ...
3
votes
2answers
663 views

tar incremental backup with --listed-incremental does not work for me (Linux, Ubuntu)

according to http://www.gnu.org/software/automake/manual/tar/Incremental-Dumps.html, i try to create incremental backups with tar and --listed-incremental on my Ubuntu, but the --listed-incremental ...
3
votes
4answers
2k views

How to manually extract a backup set made by duplicity?

I have a set of files on my webserver produced by duplicity software: duplicity-full.20110315T085334Z.vol1.difftar.gz duplicity-full.20110315T085334Z.vol2.difftar.gz ...
3
votes
2answers
715 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 ...
3
votes
1answer
1k views

tar: kill the error message: 'tar: Removing leading `/' from member names'

I run this from a cronjob: tar -czvf /var/backups/svn.tgz /var/svn/* That generates this on stderr: tar: Removing leading `/' from member names I would like to avoid this because it is not a ...
3
votes
1answer
437 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 ...