Tech 2 Game - Ultimate Tech and Game Forum
Welcome to Tech 2 Game - Ultimate Tech and Game Forum Guest!    Register | Lost Password?




Tags: Unix, File, Compression, Backup,
Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Share Post: Digg Delicious Reddit Face Book Stumbleupon
Unix File Compression and Backup
11-10-2009, 07:50 PM
Post: #1
Unix File Compression and Backup :
UNIX systems usually support a number of utilities for backing up and compressing files. The most useful are:
tar (tape archiver)

tar backs up entire directories and files onto a tape device or (more commonly) into a single disk file known as an archive. An archive is a file that contains other files plus information about them, such as their filename, owner, timestamps, and access permissions. tar does not perform any compression by default.

To create a disk file tar archive, use

$ tar -cvf archivenamefilenames

where archivename will usually have a .tar extension. Here the c option means create, v means verbose (output filenames as they are archived), and f means file.To list the contents of a tar archive, use

$ tar -tvf archivename

To restore files from a tar archive, use

$ tar -xvf archivename


cpio
cpio is another facility for creating and reading archives. Unlike tar, cpio doesn't automatically archive the contents of directories, so it's common to combine cpio with find when creating an archive:

$ find . -print -depth | cpio -ov -Htar > archivename

This will take all the files in the current directory and the
directories below and place them in an archive called archivename.The -depth option controls the order in which the filenames are produced and is recommended to prevent problems with directory permissions when doing a restore.The -o option creates the archive, the -v option prints the names of the files archived as they are added and the -H option specifies an archive format type (in this case it creates a tar archive). Another common archive type is crc, a portable format with a checksum for error control.

To list the contents of a cpio archive, use

$ cpio -tv < archivename

To restore files, use:

$ cpio -idv < archivename

Here the -d option will create directories as necessary. To force cpio to extract files on top of files of the same name that already exist (and have the same or later modification time), use the -u option.

compress, gzip
compress and gzip are utilities for compressing and decompressing individual files (which may be or may not be archive files). To compress files, use:

$ compress filename
or
$ gzip filename

In each case, filename will be deleted and replaced by a compressed file called filename.Z or filename.gz. To reverse the compression process, use:

$ compress -d filename
or
$ gzip -d filename
Find all posts by this user
Sponsored by
11-10-2009, 08:01 PM
Post: #2
RE: Unix File Compression and Backup :
really informative post, keep it up..

Hello, due to my exam I will be absent till 31 July, so for important and necessary thing, PM it to [Only Registered users can see links. ].

Thank you,
Sukanjan.K

Visit this user's website Find all posts by this user
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  For each of ur directories how to Check the disk usage in unix rin2 0 114 12-11-2009 08:20 PM
Last Post: rin2
  How to see the Disk usagein unix rin2 0 61 12-11-2009 08:11 PM
Last Post: rin2
  What is the "Top" command in unix rin2 0 80 12-11-2009 07:53 PM
Last Post: rin2
  Finding Files in Unix rin2 0 106 11-14-2009 07:08 PM
Last Post: rin2
  Finding Text in Files in Unix rin2 0 130 11-14-2009 07:03 PM
Last Post: rin2
  Handling Removable Media in Unix rin2 0 128 11-14-2009 06:56 PM
Last Post: rin2
  Find UNIX Directory Structure rin2 0 269 11-08-2009 07:11 PM
Last Post: rin2
  File Embedder Project in C admin 0 64 08-12-2009 06:47 PM
Last Post: admin


[-]
Permissions Box
You cannot Post Threads.
You cannot Post Replies.
You cannot Post Attachments.
You cannot Edit Your Posts.
HTML is off
MyCode is on
Smilies is on
[img]-code is on