1 / 43

Compression, backup, and software installation

Compression, backup, and software installation. Unit objectives Use compression utilities to compress and decompress files Perform system backups and view and extract archives Compile and install software packages from source code and use the Red Hat Package Manager. Topic A: Compression.

zariel
Download Presentation

Compression, backup, and software installation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Compression, backup, and software installation Unit objectives • Use compression utilities to compress and decompress files • Perform system backups and view and extract archives • Compile and install software packages from source code and use the Red Hat Package Manager

  2. Topic A: Compression

  3. Compression • Process in which files are reduced in size by a compression algorithm • Compression algorithm • Instructions used to reduce the contents of a file • Compress • Gzip • bzipw

  4. The compress utility • Uses LZW algorithm • Average ratio: 40-50% • Files have .Z extension • compress –v samplefile sapmplefile2 • Compress both samplefile and samplefile2 • Replaces original files with .Z files

  5. The compress utility • zcat • Used to view the contents of archive created with compress or gzip • zmore • Used to view page-by-page • uncompress • Decompresses files that were processed with compress • Also a filter for redirect from stout • who | compress –v >file.Z

  6. Common options with the compress utility

  7. GNU zip (gzip) • Algorithm varies slightly from that used by compress • Lempel-Ziv (LZ77) • Yields better compression • Typical ratio: 60-70% • zcat and zmore work on gzipped files • decompress with gunzip or gzip -d

  8. Common options with gzip continued

  9. Common options with gzip, continued

  10. The bzip2 utility • Uses a different algorithm from compress or gzip • Burrows-Wheeler Block Sort and huffman coding • zcat and zmore can’t be used • Average ratio: 50-75% • bzcat • Used to view the contents of archive created with bzip2 • bunzip2 • Used to decompress files

  11. Common options with bzip2

  12. Topic B: System backup

  13. Importance of backup • Process of copying files to an archive • Archive • Location (file or device) that contains a copy of files • Typically created by a backup utility

  14. Backup Media • Tapes, zip, flash, memory devices, optical, etc.

  15. magnetic tape (mt) command • Used to control tape devices • mt –f /dev/st0 rewind

  16. Planning a backup • Not all files need backing up • Back up user created files and configs • Not progams or temp files • After you select the files, use a utility to back them up

  17. Backup utilities • tar • cpio • dump/restore • burning software

  18. Tape archive (tar) • One of the oldest and most common backup utilities • Accepts options to determine the location of the archive and the action to perform on the archive

  19. Common options with tar continued

  20. Common options with tar, continued continued

  21. Common options with tar, continued

  22. Common Tar usage • tar –cvf /backup.tar * • Backs up current directory • Use –P for absolute paths • Limited to 255 characters • tar –tvf /backup.tar • See the files in the tar archive

  23. Tarballs-Compressed archive • Tar does not do compression • Need to add compression to it • A gzip-compressed tar archive • Used for software distribution as well as backup • tar –zcvf /backup.tar.gz * • Creates a gziped tar archive • tar –zxvf /backup.tar.gz • Extract files from tar archive

  24. The copy in/out (cpio) utility • Common backup utility • Options similar to tar with added features • Can back up device files and long filenames • Uses absolute pathnames by default • Use –O option to send list of files to archive • -I defines where to expand from

  25. Common options with cpio

  26. Common options with cpio

  27. The dump/restore utility • Full backup • Archives an entire filesystem • Incremental backup • Archives only files modified since the last full backup • Works only with files on ext2 and ext3 filesystems

  28. A sample backup strategy

  29. Options with dump/restore

  30. restore command • Extracts archives created with the dump command

  31. Topic C:Software installation

  32. Forms of software distribution • Binary program files • Pre-compiled to run on specific hardware • Source code • Must be compiled on the local architecture • RPM package • Uses Red Hat Package Management system

  33. Source code • Independent of hardware platform • Procedure for compiling source code into binary programs is standardized among most open source developers • GNU C Compiler (gcc) • Used to compile source code into binary programs

  34. Package manager • Defines a standard package format • Can be used to install, query, and remove packages • Red Hat Package Manager (RPM) • The most commonly used

  35. Installing from source code • Uncompress and extract files • Run configure • Run make • Run make install

  36. RPMs • Filenames indicate hardware architecture the software was compiled for • rpm command • Command used to install, query, and remove RPM packages

  37. Removing packages • Use RPM command with –e option

  38. Common options with RPM

  39. Common options with RPM

  40. Red Hat Package Manager • Graphical tool that may be used to install RPM packages available with the GNOME/KDE desktop environment

  41. The RPM interface

  42. Unit summary • Compressed and decompressed files using compression utilities • Performed system backups and viewed and extracted archives • Compiled and installed software from source code and used the Red Hat Package Manager

  43. Any Questions?

More Related