340 likes | 449 Views
Chapter 12 Backing Up and Restoring. Backup Methodology. tar Command. $ tar _ _ _ files.tar file1 file2 tar function(s) archivefile filename (s). first character position: c(reate) t(able of contents) x(extract) second character position: v = verbose
E N D
Chapter 12 Backing Up and Restoring
tar Command $ tar _ _ _ files.tar file1 file2 tar function(s) archivefile filename (s) • first character position: • c(reate) • t(able of contents) • x(extract) • second character position: • v = verbose • third character position: • f = filename • none = default device
compress & uncompress Commands Compress the file $ compress -v bin.file bin.file: compression: 53.81% -- replaced with bin.file.Z List the file to see compressed size $ ls -l bin.file.Z -rw-r--r-- 1 user2 staff 26500 Mar 22 09:17 bin.file.Z Uncompress the file and list again $ uncompress -v bin.file.Z bin.file.Z: -- replaced with bin.file $ ls -l bin.file -rw-r--r-- 1 user2 staff 57380 Mar 22 09:17 bin.file
Extracting Files with tar $ cd $ mkdir newhome $ cd newhome $ tar xv $ uncompress home.tar.Z $ tar xvf home.tar
Using the jar Command (java archive) combines multiple files and compresses in one step syntax and options almost identical to tar
Labs/Assessment Lab 12.4.1 Using Archive Tools - tar, compress and jar Lab 12.5.2 Using CDE to Archive, Compress and Restore chapter 12 assessment
Chap 12 Exercises 1. make a new directory
Chap 12 Exercises 1. make a new directory $ mkdir homedir
Chap 12 Exercises 1. make a new directory $ mkdir homedir 2. backup all files to this file & verify
Chap 12 Exercises 1. make a new directory $ mkdir homedir 2. backup all files to this file & verify $ tar cvf /tmp/homefiles.tar ~ $ ls /tmp/home*
Chap 12 Exercises 1. make a new directory $ mkdir homedir 2. backup all files to this file & verify $ tar cvf /tmp/homefiles.tar ~ $ ls /tmp/home* 3. list contents
Chap 12 Exercises 1. make a new directory $ mkdir homedir 2. backup all files to this file & verify $ tar cvf /tmp/homefiles.tar ~ $ ls /tmp/home* 3. list contents $ tar tvf /tmp/homefiles.tar
Chap 12 Exercises 1. make a new directory $ mkdir homedir 2. backup all files to this file & verify $ tar cvf /tmp/homefiles.tar ~ $ ls /tmp/home* 3. list contents $ tar tvf /tmp/homefiles.tar 4. compress file & verify
Chap 12 Exercises 1. make a new directory $ mkdir homedir 2. backup all files to this file & verify $ tar cvf /tmp/homefiles.tar ~ $ ls /tmp/home* 3. list contents $ tar tvf /tmp/homefiles.tar 4. compress file & verify $ compress -v /tmp/homefiles.tar $ ls /tmp/home
Chap 12 Exercises 1. make a new directory $ mkdir homedir 2. backup all files to this file & verify $ tar cvf /tmp/homefiles.tar ~ $ ls /tmp/home* 3. list contents $ tar tvf /tmp/homefiles.tar 4. compress file & verify $ compress -v /tmp/homefiles.tar $ ls /tmp/home 5. copy to homedir
Chap 12 Exercises 1. make a new directory $ mkdir homedir 2. backup all files to this file & verify $ tar cvf /tmp/homefiles.tar ~ $ ls /tmp/home* 3. list contents $ tar tvf /tmp/homefiles.tar 4. compress file & verify $ compress -v /tmp/homefiles.tar $ ls /tmp/home 5. copy to homedir $ cp /tmp/homefiles.tar.Z ~/homedir
Chap 12 Exercises 1. make a new directory $ mkdir homedir 2. backup all files to this file & verify $ tar cvf /tmp/homefiles.tar ~ $ ls /tmp/home* 3. list contents $ tar tvf /tmp/homefiles.tar 4. compress file & verify $ compress -v /tmp/homefiles.tar $ ls /tmp/home 5. copy to home.dir $ cp /tmp/homefiles.tar.Z ~/homedir 6. uncompress that file
Chap 12 Exercises 1. make a new directory $ mkdir homedir 2. backup all files to this file & verify $ tar cvf /tmp/homefiles.tar ~ $ ls /tmp/home* 3. list contents $ tar tvf /tmp/homefiles.tar 4. compress file & verify $ compress -v /tmp/homefiles.tar $ ls /tmp/home 5. copy to home.dir $ cp /tmp/homefiles.tar.Z ~/homedir 6. uncompress that file $ uncompress homefiles.tar.Z
Chap 12 Exercises 1. make a new directory $ mkdir homedir 2. backup all files to this file & verify $ tar cvf /tmp/homefiles.tar ~ $ ls /tmp/home* 3. list contents $ tar tvf /tmp/homefiles.tar 4. compress file & verify $ compress -v /tmp/homefiles.tar $ ls /tmp/home 5. copy to home.dir $ cp /tmp/homefiles.tar.Z ~/homedir 6. uncompress that file $ uncompress homefiles.tar.Z 7. extract the contents and verify
Chap 12 Exercises 1. make a new directory $ mkdir homedir 2. backup all files to this file & verify $ tar cvf /tmp/homefiles.tar ~ $ ls /tmp/home* 3. list contents $ tar tvf /tmp/homefiles.tar 4. compress file & verify $ compress -v /tmp/homefiles.tar $ ls /tmp/home 5. copy to home.dir $ cp /tmp/homefiles.tar.Z ~/homedir 6. uncompress that file $ uncompress homefiles.tar.Z 7. extract the contents and verify $ tar xvf homefiles.tar $ ls
Chap 12 Exercises 1. go to home directory
Chap 12 Exercises 1. go to home directory $ cd
Chap 12 Exercises 1. go to home directory $ cd 2. compress & archive a file
Chap 12 Exercises 1. go to home directory $ cd 2. compress & archive a file $ jar cvf /tmp/dir1files.jar dir1
Chap 12 Exercises 1. go to home directory $ cd 2. compress & archive a file $ jar cvf /tmp/dir1files.jar dir1 3. list contents
Chap 12 Exercises 1. go to home directory $ cd 2. compress & archive a file $ jar cvf /tmp/dir1files.jar dir1 3. list contents $ jar tvf /tmp/dir1files.jar
Chap 12 Exercises 1. go to home directory $ cd 2. compress & archive a file $ jar cvf /tmp/dir1files.jar dir1 3. list contents $ jar tvf /tmp/dir1files.jar 4. remove directory 1 and verify
Chap 12 Exercises 1. go to home directory $ cd 2. compress & archive a file $ jar cvf /tmp/dir1files.jar dir1 3. list contents $ jar tvf /tmp/dir1files.jar 4. remove directory 1 and verify $ rm -r dir1 $ ls
Chap 12 Exercises 1. go to home directory $ cd 2. compress & archive a file $ jar cvf /tmp/dir1files.jar dir1 3. list contents $ jar tvf /tmp/dir1files.jar 4. remove directory 1 and verify $ rm -r dir1 $ ls 5. extract the archived dir1 to your current directory
Chap 12 Exercises 1. go to home directory $ cd 2. compress & archive a file $ jar cvf /tmp/dir1files.jar dir1 3. list contents $ jar tvf /tmp/dir1files.jar 4. remove directory 1 and verify $ rm -r dir1 $ ls 5. extract the archived dir1 to your current directory $ jar xvf /tmp/dir1files.jar