Question
Hey i have a homework i need help i can not fix it . You are to write a script that will backup a directory
Hey i have a homework i need help i can not fix it . You are to write a script that will backup a directory using the tar utility. Call this script backup.sh. The directory to be backed up should be an argument to backup.sh on the command line. You may assume that the argument is not an absolute pathname, nor does it have any slashes (/) in it i.e., the directory to be backed up is directly under your current directory. Create a directory under your home directory called backups - this is where the tar file should go. If a directory was given on the command line as dirname, the tar file should be named backup.dirname.mm.dd.yyyy.tar. Note: look at the man pages for date to see how to concatenate the date in the format shown. In addition: 1 Before actually archiving the file, print a message like Backing up Scripts to /home/betul/backups/backup.Scripts.02.10.2015.tar. When the file is archived, print the message Done Do any appropriate error checking (e.g. if the given directory does not exist), and print an appropriate message. After you have the script working, alias it in your .bashrc file so that you can use the command backup from any where. Note: you will have to open a new terminal to test the alias or do source ./bashrc for the alias to take effect in the current terminal. Turn in both the script and your .bashrc file.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started