Question: Part 2 : Backing Up Files For this part, write a shell script named backup - home that creates a new directory / var /

Part 2: Backing Up Files
For this part, write a shell script named backup-home that creates a new directory /var/backup, then backs up all files in all users' home directories to a file located at /var/backup/home.tar.bz2 in compressed form.
This is fairly easy to do when you know that (1) all non-root users' home directories are nested inside the directory /home and (2) the tar command automatically makes copies of all files in a given directory and its subdirectories.
You will need to use the bzip2 compression program from Linux Assignment 8 andLBFH chapter 9. Remember to use the -f or --file option on the tar command to set the backup file's name.
Test your script by running
sudo ./backup-home
from anywhere on your system. Then use
sudo tar tjf /var/backup/home.tar.bz2| less
to see what is inside the file. Does it contain all of the files and directories that you expect? (Press the 'q' key to exit less when you are done.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!