Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

bartleby

Concept explainers

Question
QUESTION 2: A Backup Script
Write a script called: backup SWITCH FILES DEST MESSAGE
Example: ./backup -D ~/source/*.c ~/backup
Where:
SWITCH is optional: -D for deleting original files after backup. If not
present, the original files to be backed-up are not deleted.
FILES is the path, using wild cards, of the files to be backed-up.
DEST is the path to the backup directory.
MESSAGE is a multiword description about the backup. It will be added to a log
file.
Use vi to create the script.
The script must do the following in the order presented:
1. Make sure the script is running under Bash.
2.
Verify that the script has the correct number of arguments. If it does not the script
must terminate with the following error message: "You have the incorrect number
of arguments. The correct syntax is: ./backup SWITCH FILES DEST MESSAGE.
Please try again."
3. Verify that the DEST directory exists. If it does exist, then do nothing. If it does
not exist, then create the directory.
4. Using the TAR command, backup all the FILES to DEST. Call the backup file
name: "backupDATE.tar". Where DATE is today's date (not time).
5. CHMOD the tar file as RW for only the owner.
6. Append to a logfile called "backups.log" the MESSAGE preceded by todays date
and time. This logfile is within the backup directory. The format of this log
message is: DATE TIME MESSAGE. It is all on one line. Each time the backup
script is called a new log is appended to this file.
expand button
Transcribed Image Text:QUESTION 2: A Backup Script Write a script called: backup SWITCH FILES DEST MESSAGE Example: ./backup -D ~/source/*.c ~/backup Where: SWITCH is optional: -D for deleting original files after backup. If not present, the original files to be backed-up are not deleted. FILES is the path, using wild cards, of the files to be backed-up. DEST is the path to the backup directory. MESSAGE is a multiword description about the backup. It will be added to a log file. Use vi to create the script. The script must do the following in the order presented: 1. Make sure the script is running under Bash. 2. Verify that the script has the correct number of arguments. If it does not the script must terminate with the following error message: "You have the incorrect number of arguments. The correct syntax is: ./backup SWITCH FILES DEST MESSAGE. Please try again." 3. Verify that the DEST directory exists. If it does exist, then do nothing. If it does not exist, then create the directory. 4. Using the TAR command, backup all the FILES to DEST. Call the backup file name: "backupDATE.tar". Where DATE is today's date (not time). 5. CHMOD the tar file as RW for only the owner. 6. Append to a logfile called "backups.log" the MESSAGE preceded by todays date and time. This logfile is within the backup directory. The format of this log message is: DATE TIME MESSAGE. It is all on one line. Each time the backup script is called a new log is appended to this file.
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education