1 / 19

CIS 240 Introduction to UNIX Instructor: Sue Sampson

CIS 240 Introduction to UNIX Instructor: Sue Sampson. CIS240 – Backup and Restore. Planning for Disasters and Everyday Needs Backup Media Backing Up and Restoring Files and Filesystems Compressing Archived Files. CIS240 – Backup and Restore. Planning for Disasters and Everyday Needs

bambi
Download Presentation

CIS 240 Introduction to UNIX Instructor: Sue Sampson

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. CIS 240 Introduction to UNIX Instructor: Sue Sampson

  2. CIS240 – Backup and Restore • Planning for Disasters and Everyday Needs • Backup Media • Backing Up and Restoring Files and Filesystems • Compressing Archived Files

  3. CIS240 – Backup and Restore Planning for Disasters and Everyday Needs • Factors to consider • Backup Strategies • Storage Considerations

  4. CIS240 – Backup and Restore Factors to consider • What files need to be backed up? • Where are these files? • Who will back up the files? • Where, when, and under what conditions should backups be performed? • How often do these files change? • How quickly does an important missing or damaged file need to be restored? • Where will the data be restored?

  5. CIS240 – Backup and Restore Backup Strategies • Full Backup • All files are backed up • Incremental Backup • Files changed since the last backup are backed up • Unattended Backups • Backups are automatically started at a scheduled time

  6. CIS240 – Backup and Restore Storage Considerations • Know where things are • Make routine restorations easy • Write-protect backup media • Environmental considerations • Handle media properly • Take security into account

  7. CIS240 – Backup and Restore Backup Media • Magnetic tape • Floppy disks • Removable disks • Floptical and Magneto Optical Disks • Write-once CD-ROMS • Jukeboxes, Stackloaders, and Similar Devices • Hard disks

  8. CIS240 – Backup and Restore Backing Up and Restoring Files and Filesystems • Tape archive (tar) Format tar <options> <archive> <file(s)>

  9. CIS240 – Backup and Restore tar <options> <archive> <file(s)> • c Create an archive file and add files to it • f <archive> Name of archive file • r Record files at the end of the archive (append) • t List the contents of an archive file • u Update by adding new or changed files • v Verbose – list file names as they are processed • x Extract files from archive (restore)

  10. CIS240 – Backup and Restore tar <options> <archive> <file(s)> • Can be device, such as tape backup, recordable/rewritable CD ROM, or floppy • Can be a path name on an existing mounted device (hard drive, floppy, etc)

  11. CIS240 – Backup and Restore tar <options> <archive> <file(s)> • Relative or absolute path name of files • Must be specified for backup (tar responds with “Cowardly refusing to create empty tape archive…” error message if you don’t) • A period indicates all files at the current location are to be backed up. • Default for restore operation is all files in the archive.

  12. CIS240 – Backup and Restore Backup Example 1 tar cvf archive1.tar lab8/ Backs up all files in the /lab8a directory to an archive file called archive1.tar. Provides a complete list of backup operations.

  13. CIS240 – Backup and Restore Backup Example 2 tar cvf archive2.tar *.doc Backs up all files in the current directory that have an extension of .doc to an archive file called archive2.tar. Provides a complete list of backup operations.

  14. CIS240 – Backup and Restore View Contents of .tar File tar tvf archive1.tar Prints a list of all files and directories in the archive.

  15. CIS240 – Backup and Restore Restore Example 1) Copy or move the archive file to the directory you want to restore to, then execute tar from that directory… cp archive1.tar ~/backups tar xvf archive1.tar 2) Provide complete path for archive… tar xvf ~/testtar/archive1.tar Restores all files and directories in archive1.tar to the current directory

  16. CIS240 – Backup and Restore Tips on Using tar • Case is important • Spaces are important • Using an incorrect option will cause unpredictable results • Leaving out information will cause tar to hang • <Ctrl C> will break you out of tar

  17. CIS240 – Backup and Restore Compression Example 1 tar czvf myzip.tar.gz *.doc Compresses and packages all files in the current directory with an extension of .doc into one file named myzip.tar.gz.

  18. CIS240 – Backup and Restore Compression Example 2 gzip mydoc.doc Compresses and replaces mydoc.doc file with compressed version, mydoc.doc.gz.

  19. CIS240 – Backup and Restore Decompression Examples gunzip mydoc.doc.gz Decompresses and replaces file, mydoc.doc.gz with uncompressed version, mydoc.doc If you used tar and compress together, decompress the package, then unpack it… gunzip myzip.tar.gz tar xvf myzip.tar

More Related