Presentation is loading. Please wait.

Presentation is loading. Please wait.

Offline File Storage. Module 12 Offline File Storage ♦ Introduction Backup is usually done by first collecting all the data in a single archive file,

Similar presentations


Presentation on theme: "Offline File Storage. Module 12 Offline File Storage ♦ Introduction Backup is usually done by first collecting all the data in a single archive file,"— Presentation transcript:

1 Offline File Storage

2 Module 12 Offline File Storage ♦ Introduction Backup is usually done by first collecting all the data in a single archive file, which can be compressed using the compression tools. ♦ Topic ► Storing files to Media

3 Offline File Storage Storage files to Media ♦ Backing up of a system is the most major task to be performed by a system administrator. ♦ Computers have the major advantage of storing the data, which makes it significant. ♦ Backups are important because of the possibility of loss of data. ♦ The possibility of data loss can be by: ► File system corruption ► Accidental removal of files ► Hardware failures ► System crash Contd…

4 Offline File Storage Contd… ♦ Backup Media ► The following are some of the methods of back up through media floppy disks Tapes removable hard disks rewritable CD-ROMs ♦ Backup tools ► tar ► dd ► Dump ► cpio Storage files to Media

5 Offline File Storage Contd… Storage files to Media ♦ Backup using tar command An archiving program designed to store and extract files from an archive file known as a tarfile. The tar is the most commonly used command for the backup. ► tar options tar –cvf (creating the tar file) tar –tvf (listing the contents of tar file) tar –xvf (extracting the contents of tar file) – where, c – create t – list x – extract v – verbose f – file

6 Offline File Storage Contd… ♦ Backup using dd command dd copies a file from source to destination. It copies an input file (if) file and sends the result to the output file (of) which converts and formats according to the options. ► Syntax # dd if= of= ► Example dd if=bootdisk.img of=/dev/fd0 Storage files to Media

7 Offline File Storage Contd… ♦ Backup using dump/restore command ► dump and restore commands are the two different programs that are included in the dump package. ► These files are copied to the given disk, tape or other storage medium for protection. ► Syntax dump - - Storage files to Media

8 Offline File Storage Contd… Storage files to Media ♦ Example: dump -0 –f /home_dumps/mydumps /home ► where, -0 - dump level (full backup) -f - write a backup to file

9 Offline File Storage Contd… Storage files to Media ♦ Backup using restore command ► The restore command is used to view and restore the dump file. ► Syntax: # restore - ► Example: restore –if mydumps where, -i is interactive restoration -f is read backup from file

10 Offline File Storage Contd… ♦ Backup using cpio command ► The cpio command is a tool for creating and extracting archives, or copying files from one place to another, which contains other files and information about them, such as their file name, owner, timestamps, and access permissions. ► It handles a number of cpio formats as well as reading and writing tar files. The archive can be another file on the disk, a magnetic tape, or a pipe. Storage files to Media

11 Offline File Storage Contd… ♦ cpio has three operating modes. ► copy-out mode, cpio copies files into an archive. ► copy-in mode, cpio copies files out of an archive or lists the archive contents. ► copy-pass mode, cpio copies files from one directory tree to another, combining the copy-out and copy-in steps without actually using an archive. Storage files to Media

12 Offline File Storage Contd… ♦ Syntax for creating the cpio file ► find (source file name) | cpio –(options) > (target file name) ► Example: find file1 | cpio -o > file1_back.cpio ► Syntax for extracting the cpio file cat | cpio –(options) ► Example: cat file1_back.cpio | cpio –idvm where, d – make directories i – extract m – modification time o – create v – verbose Storage files to Media

13 Offline File Storage Contd… Storage files to Media ♦ Compression tools ► Zip zip is a compression and file packaging utility. The program is useful for packaging a set of files for distribution, archiving files and saving disk space by temporarily compressing unused files or directories. The zip program puts one or more compressed files into a single zip archive, along with information about the files. An entire directory structure can be packed into a zip archive with a single command. ► Syntax zip ► Example: zip install install.log

14 Offline File Storage Contd… ♦ unzip ► unzip will list, test, or extract files from a zip archive, commonly found on MS-DOS systems. The default behavior (with no options) is to extract into the current directory and subdirectories all files from the specified zip archive. ► Syntax unzip ► Example: unzip install.zip Storage files to Media

15 Offline File Storage Contd… Storage files to Media ♦ Gzip By default, gzip keeps the original file name and timestamp in the compressed file. These are used when decompressing the file with the –N option. The main advantage of gzip over compress is it has a better compression capacity than other compression tools. ► Syntax gzip ► Example gzip install.log

16 Offline File Storage Contd… ♦ Gunzip gunzip decompress the files created by gzip. It takes a list of files on its command line and replaces each file ending with.gz, -gz,.z, -z, _z or.Z and which begins with the correct number with an uncompressed file without the original extension. gunzip also recognizes the special extensions.tgz and.taz as shortcuts for.tar.gz and.tar.Z respectively. ♦ Syntax ► gunzip ♦ Example: ► gunzip install.log.gz Storage files to Media

17 Offline File Storage Contd… Storage files to Media ♦ Bzip2 bzip2 is a block-sorting file compressor. It expects a list of file names to accompany the command-line tools. Each file is replaced by a compressed version of itself, with the name ‘original_name.bz2’. Each compressed file has the same modification date, permissions and when possible ownership as the corresponding original, so that these properties can be correctly restored at decompression time. ► Syntax bzip2 ► Example: bzip2 install.log

18 Offline File Storage Storage files to Media ♦ Bunzip2 bunzip2 (or bzip2 -d) decompresses all specified files. bzip2 attempts to guess the filename for the decompressed file from that of the compressed file. If the file does not end in one of the recognized endings,.bz2,.bz,.tbz2 or.tbz, bzip2 gives an error message that it cannot guess the name of the original file, and uses the original name with.out. ► Syntax bunzip ► Example: bunzip install.log.bz2

19 Offline File Storage ♦ Backup any desired directory using tar command ♦ Compress the file mydata from the data directory and uncompress into a new directory by name backup using zip and unzip commands ♦ Backup the /tmp directory into a new directory by name tmp_backup using dump command Lab Exercise


Download ppt "Offline File Storage. Module 12 Offline File Storage ♦ Introduction Backup is usually done by first collecting all the data in a single archive file,"

Similar presentations


Ads by Google