Question: Create a bash script named backup.sh. This script should create a tar file containing all .c files in the current directory, gzip that tar file,

Create a bash script named backup.sh. This script should create a tar file containing all .c files in the current directory, gzip that tar file, copy the resulting file to the users home directory, and report that the file was created. The date of the create gzip file should include the current date and time (using 24-hour time format, not 12 hour).

The output of your program should look like this:

$ ls

backup.sh goodbye.c hello.c

$ ./backup.sh

all .c files copied to ~/backup2016-09-21_09-29.tar.gz

$ ls ~/back*

/home/CLASSES/tedzanella/backup2016-09-21_09-29.tar.gz

$

The file name format should be exactly as shown, with first the year, month, and day, separated by hyphens, then an underscore, then the hour and minute, separated by a hyphen.

Do not hard code the home directory into the script. It should copy to the file to the home directory of whoever is running the script.

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 Databases Questions!