Program for create a menu, Programming Languages

Assignment Help:

The creation of the menu will involve writing procedural code, using decision logic, writing a loop, and using the case statement.  Although it is not required for grading, it is recommended that you flowchart and /or pseudo code your solution before coding.

General requirements

1. The script should contain a comment header as we discussed in class.  Include comments / pseudo code in your script.

2. Include the 'shebang' line for the bash shell found on Ubuntu.

3. Redirect any errors to a separate error file.

4. Clear the screen, change directories to the directory and present the current directory to the screen.

5. Make your file read, write, executable for the owner (that's you), read and executable for group and no permissions for other. -rwxr-x---

6. Create all report files with read only permissions for owner and group and no permissions for other.

7. At top of the menu check for the existence of the subdirectory logs.  If it does not exist, create it. 

8. Store the program directory in a variable and use it to define the full file name.

9. For each report write the files to the new logs directory, add the time to make it unique for each instance, i.e. whoyymmddhhmm.rpt

10. After writing the report to the disk, display all of the reports to the screen.  Look into using the awk program to 'pretty up' the report.  See the examples in the exercises.

11. Create a separate error file for each of the menu selections, adding the date and time like the report file, i.e. whoyymmddhhmm.err

The menu

1. Create a menu with the following selections (Hint start out by just creating the menu and echoing a message on the screen when a selection is made:

a. Who is on system report

b. Process Report

c. Web server report

d. Disk Space Report

e. Backup reports

f. Quit

2. Who is on System Report  --Create a new empty file to contain the first report.

a. Put the current date and time at the top of the file in this format: MM/DD/YY HH:DD (hint not default output - use formatting.)

b. List the users on the system and redirect the output from standard output to the file retaining the date and time you put in the file in task above.

c. Count the number of users on the system and add it to the end of the file.

d. Using one of the paginators, view the file you just created

3. User Process Report -- Create a second new file to contain report 2

a. Put the current date and time at the top of the file in this format: MM/DD/YY HH:DD (hint not default output - use formatting.)

b. List all of the processes associated with a tty into the file.

c. Sort the file by the process id.

d. Count the number of processes and put to the bottom of the file.

e. Using one of the paginators, view the file you just created

4. Web Server Report -- check for the program httpd.  Print a message on the screen with the status.  No files needed here.

5. Backup Reports -- Use the tar command and create a backup.  The backup should have the following functionality:

a. In the new logs directory, check to see if a sub-directory of archive exists, if it does not create it. 

b. Archive the files into a compressed tar ball in the logs/archive folder. 

c. Check if the file to check if it was created and has size greater than zero.

d. Check the file counts in the tar ball valid (hint use a file size check and/or compare the file count from the tar tv command with the count of files from the ls command)

e. If the backup passed the validation, remove the report and error files.


Related Discussions:- Program for create a menu

Matrices and vectors, This section is proposed to be a catch all for severa...

This section is proposed to be a catch all for several of the fundamental concepts which are used occasionally in working with systems of differential equations. There will not be

Expression Tree, For this assignment you will read a file expression.txt an...

For this assignment you will read a file expression.txt and create an expression tree. The expression will be a valid infix expression with the all the necessary parentheses so tha

Irc or internet relay chat application, Programming Project Specification: ...

Programming Project Specification: IRC or Internet Relay Chat is an application that lets multiple users communicate via text messages with each other in common "virtual" rooms.

Explain the break statement - computer programming, Explain the Break State...

Explain the Break Statement - Computer Programming? The break statement is used as an interrupt to the normal flow of control this statement causes as exit from the switch stat

To execute other program from already executing shell script, Normal 0 ...

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

What is the purpose of a hashtable, Question: (a) How do you implement...

Question: (a) How do you implement the following in ASP.NET: (i) Server-side Comments (ii) Server-side Include Directives. (b) What is the purpose of a HashTable? (

No Linux Audible, Why no Audible support for Linux? Maybe they should use a...

Why no Audible support for Linux? Maybe they should use a browser interface?

Write a program to draw a sketch of a cow, write a program to draw a cow. N...

write a program to draw a cow. Now, draw a cow standing amongst the grass, with (say) 500 blades of grass. Each blade of grass should be a separate random green line. Do all your d

Fortran programming, Question 1- In engineering applications it is often ne...

Question 1- In engineering applications it is often necessary to fit a straight line to a set of N points with known coordinates (xi, yi), where i indexes the points (N in total).

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd