Visit Our UNIX and Linux User Community


tar compression - please help


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers tar compression - please help
# 1  
Old 07-31-2001
tar compression - please help

I'm backing up one of my sites, and will be moving to another host. This was an expermintal site, and many of the directories won't be needed.

What tar command is needed to exclude directories from the compressed file? Could you also give an example.

also this might be the same comand, but -
what command is need to only compress FILES in the current directory, but not to include any DIRECTORIES?

I did check the man pages
-exclude
-x

but i'm not sure on how to use.

Thanks in advance,
-Taylor




# 2  
Old 08-01-2001
My advise would be to simply tar and compress some test files and then untar them with your -exclude flag using one or more test files. After a few minutes of experimentation on the test files, you will be a pro with the -exclude switch.
# 3  
Old 08-07-2001
I hope this will help..

1. At your target hosts modify your /.rhosts file and add the source hostname and user.
ex: serverA [tab] root

2. At the source hosts execute this command:
tar cvfp - <directory / file to backup> | rsh <target hosts> " cd <target directory> ; tar xvfp - "

3. That's it, your files / directory will now backed up at other hosts with preserved permission and owner.
# 4  
Old 08-07-2001
Looks like the previous poster's reply got munged because he used angle brackets. That should have read:

Code:
tar cvfp - &lt;directory / file to backup&gt; | rsh &lt;target hosts&gt; " cd &lt;target directory&gt; ; tar xvfp - "

The only modification i would make would be to change it to:

Code:
tar cvfp - &lt;directory / file to backup&gt; | rsh &lt;target hosts&gt; " cd &lt;target directory&gt; && tar xvfp - "

The "&&" after the cd command ensures that the files are not extracted if for some reason the cd command fails. If, for example, you make a typing mistake in the path, the files would be extracted in your home directory instead which is probably not what you wanted.
# 5  
Old 08-08-2001
Bug

Thanks,

I knew this was the right place to ask

-Taylor
 

Previous Thread | Next Thread
Test Your Knowledge in Computers #252
Difficulty: Easy
Network computer devices that originate, route and terminate the data are called server-only devices.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Tar gzip compression rate

How good is the compression rate of gzip when you use tar with the gzip option? I am pretty amazed that a 1 GB file was reduced to 1019K. This is what I did. tar -cvf tar_test.tar.gz -T /list_of_files ls -hl -rw-r-----. 1 owner group 19 Jul 23 16:00 list_of_files -rw-r-----. 1 owner group... (7 Replies)
Discussion started by: cokedude
7 Replies

2. Linux

Best Compression technique ?

Hi all, I am working on a sample backup code, where i read the files per 7200 bytes and send it to server. Before sending to server, i compress each 7200 bytes using zlib compression algorithm using dictionary max length of 1.5 MB . I find zlib is slow. Can anyone recommend me a... (3 Replies)
Discussion started by: selvarajvss
3 Replies

3. Shell Programming and Scripting

tar command to explore multiple layers of tar and tar.gz files

Hi all, I have a tar file and inside that tar file is a folder with additional tar.gz files. What I want to do is look inside the first tar file and then find the second tar file I'm looking for, look inside that tar.gz file to find a certain directory. I'm encountering issues by trying to... (1 Reply)
Discussion started by: bashnewbee
1 Replies

4. Shell Programming and Scripting

file compression

I'am looking for script (or tool) that would compress all files with given extension in all subdirectory. Important part is that every one file have to end in separate archive whit it's own name. Eaven if I could point multiple file in one directory and compress them it would be ok. I' am... (1 Reply)
Discussion started by: Demerzel
1 Replies

5. AIX

GNU Tar with compression for AIX 4.2 already compiled ?

Is there a GNU Tar available with compression option available for AIX 4.2 that I can directly use (not having to compile anything, simple installation) ? (1 Reply)
Discussion started by: Browser_ice
1 Replies

6. UNIX for Dummies Questions & Answers

tar -cvf test.tar `find . -mtime -1 -type f` only tar 1 file

Hi all, 4 files are returned when i issue 'find . -mtime -1 -type f -ls'. ./ora_475244.aud ./ora_671958.aud ./ora_934052.aud ./ora_934050.aud However, when I issued the below command: tar -cvf test.tar `find . -mtime -1 -type f`, the tar file only contains the 1st file -... (2 Replies)
Discussion started by: ahSher
2 Replies

7. AIX

AIX 4.2: tar using compression ?

Hi, is there a way to use compression on the TAR command running on a AIX 4.2 ? I did a "man tar" but did not see mentions of using compression, nor how to even find out the tar version. I want to look into ways of reducing the amount of time to do backups. One backup is dumping database... (9 Replies)
Discussion started by: Browser_ice
9 Replies

8. UNIX for Dummies Questions & Answers

.z file compression

Hello, I have a .z file which i understand to be UNIX. I'm on PC (no UNIX boxes) and have tried many different unzipping programs to extract this .z file, but only PicoZip has allowed me to view what is inside (telling me, i think, that it's not corrupt), but i have not been able to extract... (3 Replies)
Discussion started by: Gonecat
3 Replies

9. UNIX for Advanced & Expert Users

Predictor compression

Hi everybody, Does anybody know,whether linux-2.4.20-8 supports predictor1 compression in PPP protocol support,as i was able to see there were only two compression techniques that r being supported i.e bsd and deflate compression from "make menuconfig" under network device... (0 Replies)
Discussion started by: sriram.ec
0 Replies

10. UNIX for Dummies Questions & Answers

.bz2 compression

I have heard that bz2 compression a relatively new compression encoding algorithm, far superior to tar and gz. I also remember that I downloaded a FreeBSD LiveCD a while back that was only a couple hundred megs instead of the usual 650ish using bz2 - big difference, I'd say. But to the point, what... (4 Replies)
Discussion started by: Phobos
4 Replies

Featured Tech Videos