Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a script that will backup a single file to the specified location with the specified name. You can name the script backup.sh. 1. The

Write a script that will backup a single file to the specified location with the specified name. You can name the script backup.sh.

1. The script takes three parameters: the file to be backed up, the directory to save the backup, and the name of the backup. For example, I have a file called foo.txt that I want to backup to the bin folder under my home directory. I want to name the backup fooBackup: ./backup.sh foo.txt ~/bin fooBackup

2. The script will print out an informative error message if the user does not supply exactly three parameters.

3. The script needs to check that the supplied file exists and is a regular file and that the supplied directory is a directory

4. In the event that one of the above conditions fail, print out an informative error message stating the specific issue. The expectation is for only one error to print (whichever error is caught first).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions