Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

three different linux bash scrips Shell Scripting Lab 6 Exercise 1: Write a Shell script that backs up a directory using tar commands into a

three different linux bash scrips image text in transcribed
Shell Scripting Lab 6 Exercise 1: Write a Shell script that backs up a directory using "tar commands into a single file. As part of the script, ask for input into what you want to back up, and the output location and filename. Example: Example Input: Enter the directories or files for backup: /etc/var/log /home/mydirectory What do you want to name this file (add tar): mybackup- 10-09-2017 tar Where do you want to backup the file: /home/myhome The script should then do this: tar-cvf /home/mybackup-10-09-2017 tar -exclude= 'mybackup-10-09-2017.tar' letc Ivar/log/home/mydirectory Exercise 2: Modify the shell script above for the following: 1) Instead of asking for Input, utilize 3 variables example: $1 = backupfiles $2 = backupname $3 = backuplocation 2) Output a message if the user does not enter 3 variables. example: mybackup "/etc /var/log/home/mydirectory "mybackup-10-09-2017.tar Since only two entries are entered: printout: Incorrect syntax: please enter the following syntax. (Give them syntax) Example Input: mybackup "/etc /var/log/home/mydirectory "mybackup-10-09-2017.tar" "/home/myhome" Exercise 3: Create a cronjob using the script from Exercise 2. The script should run at 1:02 am every Friday night *** Hint: Remember to run crontab-e Do a crontab - to list after complete

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

More Books

Students also viewed these Databases questions

Question

dy dx Find the derivative of the function y=(4x+3)5(2x+1)2.

Answered: 1 week ago

Question

Draw and explain the operation of LVDT for pressure measurement

Answered: 1 week ago