Question: Unix Write a bash shell script called dobackup to back up specified files located in the specified directory. Have the script accept three command line
Unix
Write a bash shell script called dobackup to back up specified files located in the specified directory.
Have the script accept three command line arguments according to this syntax:
dobackup sourcePath backupBaseName fileSuffix
sourcePath, is the path to the files to be copied.
backupBaseName is the name of the targeted backup directory (Preferebly just backup)
fileSuffix is an indicator that only files with this suffix should be backed and others will be ignored. (For example cpp)
The script has to create the backup directory if one doesnt exist. A datestamp of form .yyyy-mm-dd should be added to the end of the name of backup directory. If it already exists suppress any error messages.
The script should only copy the files, not the directories. Print the name of each file it copies. For example: "backing up test1.cpp
Finally, The script should print out a correct usage message as well as a Command line syntax if invoked with less than the required number of arguments.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
