The tar archive format and/or the command-line utility for working with tar files.
2
votes
2answers
186 views
I want to tar X directory not including its parents
tar cvf /var/lib/backup/sample.tar /home/user/.project
However, when I extract, I get its parents as well
/backup/
- /home/
- /user/
- .project/
This tar commands does it job ...
5
votes
4answers
1k views
Preventing tar from using too much CPU and disk (old laptop crashes if 100%)
I want to backup 1 terabyte of data to an external disk.
I am using this command: tar cf /media/MYDISK/backup.tar mydata
PROBLEM: My poor laptop freezes and crashes whenever I use 100% CPU or 100% ...
4
votes
3answers
929 views
Why does tar --exclude=“.*” create an empty archive?
Everything I read says that to exclude .svn and .htaccess and other hidden files when creating a tar archive, use the --exclude=".*" pattern.
When I try, I get an empty archive. When I leave out the ...
4
votes
2answers
1k views
If I change permissions on a tar file, will that apply to the files inside it?
I have a script that runs regularly via cron, that creates a tar.gz file for the purpose of backing up a directory.
For reasons beyond my control, the only user who can execute the script via cron is ...
5
votes
1answer
1k views
How to check/test .tar.bz archives?
I've been using tar with its "--use-compress-prog=pbzip2" function to archive my files then compress them with pbzip2 to get an "*.tar.bz" archive.
Afterwards I checked the resulting file with ...
2
votes
2answers
207 views
Untar directory from large tarball
How do I untar a directory that I don't know the path to? I only know the directory name.
I know how to untar a single file with a wildcard: tar -xf somefile.tar.gz --wildcards --no-anchored ...
3
votes
3answers
145 views
Indexed archive format?
I need to create compressed archives of files, and be able to quickly extract individual files/directories from them.
The problem is, for example, tar.bz2 seems to be not the best choice for such ...
6
votes
1answer
6k views
How do you extract a single folder from a large tar.gz archive?
I am using this command on a 5GB archive
tar -zxvf archive.tar.gz /folder/in/archive
is this the correct way to do this? It seems to be taking forever with no command line output...
3
votes
1answer
294 views
HP-UX 9: Backup filesystem using tar
So I've got an HP-UX 9 box that I'm trying to backup, first to a tape with fbackup, to no avail, and now to a folder shared over NFS. I'm using the command "tar -cvf /nfs/Results/backup.tar /" where ...
1
vote
1answer
149 views
rpm and deb fileformat are blocked by my ISP. How to install software?
I have a very peculiar problem, Just be patient with what I am saying and then see what all suggestion you can give me.
I have situation where my ISP has blocked .rpm and .deb files to be downloaded. ...
3
votes
2answers
2k views
find a file within a tar.gz archive
Is it possible to use the find command so that it searches the files within a tar.gz archive also using wildcards?
like
find archive.tar.gz --name *foo*
2
votes
2answers
188 views
Create release version using tar
I have a project with the usual stuff (source code, yadda, yadda) and I want to have a command to Scons (but it could be whatever build system to be honest) that will do the following:
Build the ...
3
votes
2answers
809 views
Tar overwrites read only files
I created directory test, created file 1.txt in test, wrote 'Before' in this file.
Then I went
cd ..
and used the command:
tar -cvzf ./test.tgz ./test
Then I entered the test dir again. Opened ...
13
votes
5answers
14k views
tar --exclude doesn't exclude. Why?
I have this very simple line in a bash script which executes successfully (i.e. producing the _data.tar file), except that it doesn't exclude the sub-directories it is told exclude via the --exclude ...
3
votes
2answers
2k views
How to create backup from symbolic links?
I have a directory with symbolic links to other directories. I want to archive the symbolic links, not as links but as archives containing the files of directories they refer to, using tar command. ...
1
vote
1answer
253 views
Using tar on a file with an @ (at symbol)
I'm trying to extract a tarball using tar -xvf that's in the format (where * is any word character) *@*@*@*.tar.gz but I think tar is trying to find the file at a remote location. The error I get is ...
3
votes
5answers
392 views
How do I extract all .htaccess files from a tarball?
I want to extract all .htaccess files from a tarball, how can I do so? I see only one mention of "include" in the manual page of tar which is not related with an option for including only certain ...
4
votes
2answers
739 views
Why doesn't tar ask before overwriting existing files?
I lost a couple hundred lines of a Vim plugin I wrote and continue back up every so often because I extracted a tar file containing an older version. I decided not to use source control management ...
0
votes
0answers
45 views
Backing up to DVD [duplicate]
Possible Duplicate:
Splitting large directory tree into specified-size chunks?
I have a partition that is about 14G and I need to back it up to DVD in such a way that I can use each disc to ...
5
votes
1answer
902 views
Cannot open: Input/output error with tar command in a shell script
I am trying to create a tar ball in a shell script (I have enabled set -x), but I get an error:
+ cd /home5/mysite/public_html
+ TAR_DUMP=gypo_2012-02-18-03:51:15.tar.gz
+ echo 'Tar name: ...
3
votes
1answer
1k views
Will tar -cvzf packed.tar.gz mydir take hidden files into account?
I need to create a tarball of a given directory. However, I need to make sure hidden files are included too (such as those beginning with .).
Will the following command automatically take the hidden ...
4
votes
2answers
498 views
Using files that have spaces in their name in pipes
I have folder named play which contains a file damn file (with space). When I use find and pipe the output to tar:
find play/ -name 'damn*' | tar cf archive.tar -T -
It works perfectly. Why does ...
9
votes
6answers
4k views
tar + rsync + untar. Any speed benefit over just rsync?
I often find myself sending folders with 10K - 100K of files to a remote machine (within the same network on-campus).
I was just wondering if there are reasons to believe that,
tar + rsync + ...
5
votes
3answers
403 views
Look at the tar log contents without extracting them
tar -tvf file.tar contains log files.
Is there anyway to do something like this
tar -tvf file.tar | head -1 | awk '{print $NF}' | xargs less {}
This would give file not found, but is there a way?
...
4
votes
4answers
368 views
How can I move the entire OS to a different server?
I want to install RhodeCode on a test server at work. However, the internet access is restricted for that server, and RhodeCode has a lot of dependencies (I don't even have Python on that server). So ...
6
votes
5answers
916 views
force copying a corrupted home directory
I have a home directory in a disk that has a lot of corrupted files. I am trying to save most files as possible. I am trying to create a backup of my home directory on an external drive using
tar ...
9
votes
3answers
4k views
How to XZ a directory with TAR using maximum compression?
So I need to compress a directory with max compression.
How can I do it with xz? I mean I will need tar too because I can't compress a directory with only xz. Is there a oneliner to produce e.g. ...
15
votes
2answers
4k views
tar cvf or tar -cvf ?
I have learned to use tar without '-' for options, like tar cvfz dir.tar.gz Directory/ but I recently came accross the slightly different tar -czvf syntax (I think the 'f' must be the last option in ...
8
votes
2answers
1k views
How to create a tar.gz file from a folder excluding a folder
How do I exclude a file or folder while creating a tar.gz file with tar command?
-1
votes
2answers
2k views
Wait for process to finish before going to the next line in shell script
I have a script I made to create a backup. I need to make sure the backup is ready before it runs the /home/ftp.sh command. How can I do so? I use CentOS 5.6
#!/bin/bash
tar -Pcf ...
7
votes
4answers
2k views
Rename directory inside of a tar archive
Is it possible to rename a directory inside of a tar archive? My use case is that I have an externally provided RPM spec file that assumes a tarball with a certain directory structure, and I have an ...
4
votes
3answers
926 views
How store in a variable a file list that includes the backslash when needed?
Main question:
I am writing a script to perform a backup. I make a list of files in the following way:
LISTOFFILES=$(find ~ \( -name '*.[pP][dD][fF]' -o -name '*.[oO][dD][tT]' \))
The variable ...
1
vote
1answer
506 views
Create target directory when extracting tarball
Is it possible to create a target directory, similar in nature to the mkdir -p switch, where I can define a non-existent target directory within my tar command, and tar will create the directory for ...
1
vote
3answers
915 views
Use find and tar together
I have a directory with many log files, with filenames like acct.20111001 up to acct.20111030. I want to zip them by running:
tar -cvjf acct.20111001.bz2 acct.20111001
How can I use find to ...
4
votes
5answers
3k views
tar files only, no directories
I can probably write a shell script to find files only, then pass the list to tar, but I am wondering whether there already is a built-in feature in tar that allows doing just that, in a single ...
2
votes
2answers
407 views
I need to transfer a very large folder over FTP, without creating a file first
I am running an Amazon EC2 instance that is limited in disk space. I have a very large folder that I need to FTP to my local machine, preferably without creating an intermediate tar file, since there ...
4
votes
3answers
7k views
How do I extract with tar to a different directory?
This doesn't work:
tar xf /tmp/foo.tar.gz foo/bar
tar: foo/bar: Not found in archive
It's not obvious to me what would do this beyond extracting it in place and moving the files over.
1
vote
1answer
528 views
Updating tar.gz daily only with changed files [duplicate]
Possible Duplicate:
Add/update a file to an existing tar.gz archive?
I have some game files I wish to update daily and they create a tar.gz of the folder, but instead of making a full ...
3
votes
1answer
365 views
Copy just permissions and ownership from one tar file to another
I have two tar files which are basically backups of my /data folder on android. The problem is the permissions and ownership of the files inside latest back-up is messed up. However the permissions in ...
2
votes
1answer
269 views
How do I dereference links when extracting from a tar file?
If I have a tar file, bob.tar, which contains real_file and link_to_real_file, in which the latter is a symlink, is there a way to extract the contents of bob.tar so that link_to_real_file will not be ...
5
votes
2answers
2k views
tar with relative paths
I try to create an archive with tar using relative paths. I use the following command:
tar czf ~/files/wp/my-page-order.tar.gz -C ~/webapps/zers/wp-content/plugins/ ...
10
votes
5answers
4k views
“tar: unrecognized option --warning” during 'apt-get install'
I just ran apt-get upgrade on my debian 5 vps and I got this error:
tar: unrecognized option `--warning=no-timestamp'
Now when I try to install other packages e.g: imagemagick I get the same ...
0
votes
1answer
255 views
Proper way to join multi-volume tarballs?
So how should this be done? I have learned that using cat is the preferred way when using split to create multi-volume files, but what about when using tar's own native multi-volume function?
Thanks
5
votes
2answers
2k views
Can I automate tar's multi-volume-feature?
Ok, so I've just had a read through this page after a way to improve my current backup solution on my Debian server. Tar seems to be offering a quite nice multi-volume feature, although when I try it ...
3
votes
2answers
2k views
Extract multiple .tar.gz files with a single tar call
I was wondering whether (and, of course, how) it’s possible to tell tar to extract multiple files in a single run.
I’m an experienced Unix user for several years and of course I know that you can use ...
3
votes
1answer
1k views
Compress a directory using tar/gz over SSH to local computer?
I'd like to essentially tar/gz a directory on a remote machine and save the file to my local computer without having to connect back into my local machine from the remote one. Is there a way to do ...
4
votes
2answers
281 views
What do these commands (`tar`) actually do? Is there a better way?
I am going over some documentation from a former colleague of mine. This documentation pertains to creating a distro repo. However, I cannot understand exactly what this commands performs:
...
8
votes
2answers
1k views
Fastest way combine many files into one (tar czf is too slow)
Currently I'm running tar czf to combine backup files. The files are in a specific directory.
But the number of files is growing. Using tzr czf takes too much time (more than 20 minutes and ...
3
votes
2answers
1k views
Tar a folder without .git files?
If I tar a folder that is a git repository, can I do so without including the .git related files? If not, how would I go about doing that via a command?
4
votes
4answers
182 views
Generating sets of files that fit on a given media size for tar -T
Can anyone suggest a script that will take as input the name of one or more directories and a media size, and output lists of files for input to tar using -T (assuming no compression)?
...