Presentation is loading. Please wait.

Presentation is loading. Please wait.

CIS 240 Introduction to UNIX Instructor: Sue Sampson.

Similar presentations


Presentation on theme: "CIS 240 Introduction to UNIX Instructor: Sue Sampson."— 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

9 CIS240 – Backup and Restore tar c Create an archive file and add files to it f 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 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 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 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


Download ppt "CIS 240 Introduction to UNIX Instructor: Sue Sampson."

Similar presentations


Ads by Google