Question: Part 2 : Backing Up Files For this part, write a shell script named backup - home that creates a new directory / var /
Part : Backing Up Files
For this part, write a shell script named backuphome that creates a new directory varbackup then backs up all files in all users' home directories to a file located at varbackuphometar.bz in compressed form.
This is fairly easy to do when you know that all nonroot users' home directories are nested inside the directory home and the tar command automatically makes copies of all files in a given directory and its subdirectories.
You will need to use the bzip compression program from Linux Assignment andLBFH chapter 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 backuphome
from anywhere on your system. Then use
sudo tar tjf varbackuphometar.bz 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
