What kinds of activities would you use a job-scheduler for


Part -1:

Worksheet

Purpose: Use the at and batch facilities to schedule future jobs.

NOTE: These instructions reflect the user interface in version 12.04LTS of Ubuntu.

1. Start your system, log in, and open a command shell.

2. Read the manual page on the at command. Check the /etc directory for the files mentioned in the manual page. (They probably are not there.) Which option do you use to specify that the instructions for the job are contained in a file, rather than entered at the command line?

3. Use the at command to write a long listing of your home directory to the file homelist in 2 minutes.

a) Issue the at command, including the time specification. Press ENTER.
b) Type in the ls -l > homelist command and press ENTER.
c) Press d to signal the end of your instructions.

4. Use an at command to cause your schedule.sh script to execute in 2 minutes. (You obtained the schedule.sh script during Assignment #5.) Re-direct the output to a file named schedule.out in your home directory. What command did you use? (NOTE: You will want to enter the filename at the at prompt - do not try to use the -f option described on the man page.)

5. Open a new terminal window and run the top command in that window. Go back to your first window and start the zombie.sh script. Repeat the process, so that you have two versions of the script running. Check the CPU usage; it should be well above 45% for each of the two zombie.sh processes.

6. Read the manual page on the batch command. Within that document is mentioned a command which will allow you to specify the load at which the commands in the batch will be executed - name it:

7. Watch the load average numbers in your top window. (The numbers appear at the top right of the window.) The first number should quickly move above a value of 1. (The other two numbers change more slowly.) When it does, enter a batch command which will execute your schedule.sh script. You do not need to set the load level for this command; the system's default will be fine. Have the output directed to a file named schedule.batch in your home directory.

8. Watch your top window for a little while - at least 30 seconds. Do you see the script running? Check the contents of your home directory; do you see the schedule.batch file?

9. Kill the zombie.sh processes which are raising the system load using one of the techniques from Assignment 5. Watch the top window for indications that the processes have stopped. Also watch the load average at the top right side of that window. Check your home directory periodically until the first number falls below a value of 0.8. When does your batch job run?

Part -2:

Mid-Term Exam

I. Multiple Choice

DIRECTIONS: Save this document on your local machine. Use the blue-bordered box for your answers - for each question, type the answer you have selected into that box.

 1. Which of the following will allow you to exit vi from command mode?

                        a. :q!                                                    c. wq

                        b. exit                                                  d. qw

 2. What is the starting point of the UNIX directory structure called?

                        a. the current directory                       c. the root directory

                        b. the first allocated partition               d. the home directory

3. Which of the following is displayed by the ls -l command?

                        a. file permissions                                 c. file type

                        b. file size                                            d. all of the above

 4. Which command is used to control the permissions assigned to a directory?

                        a. chmod                                              c. rwx

                        b. chdir                                                d. ls x

5. Which command is used to delete files?

                        a. del                                       c. erase

                        b. rm                                        d. kill

6. What is the result of the following command? mv /root/test.txt /home/student01/test.txt

                        a. test.txt will be copied to the /root directory from the /home/student01 directory

                        b. test.txt will be copied from the /root directory to the /home/student01 directory

                      c. test.txt will be moved to the /root directory from the /home/student01 directory

                        d. test.txt will be moved from the /root directory to the /home/student01 directory

 7. What is the result of the following command?   cd /home/student01

                        a. A subdirectory called student01 will be created under the /home directory.

                      b. The current working directory will be changed to /home/student01.

                        c. The directory /home/student01 will be closed.

                      d. The directory /home/student01 will be cleared.

 8. What is the chown command used for?

                        a. Changing the user and group ownership of a file, set of files, or a directory.

                        b. Changing the owner name on a user account.

                      c. Changing the read/write/execute permissions for a file, set of files, or a directory.

                      d. Changing the user ID and password on a user account.

 9. What sequence of keystrokes will kill a foreground process in UNIX?

                        a. [Ctrl] c                                 c. [Ctrl] a

                        b. [Esc] c                                 d. bash

10. Which key allows you to scroll backward when using the less command or when reading a man page?

                        a. [Esc]                                  c. b

                        b. [Backspace]                         d. [F2]

11. Which command will append the contents of a file named epilogue to a file named book?

                        a. append epilogue to book          c. ln -s book epilogue

                        b. merge book epilogue               d. cat epilogue >> book

12. Which UNIX command is used to get information about UNIX commands?

                        a. find                                      c. describe

                        b. rf (short for reference)            d. man (short for manual page)

13. A user named verin could create a directory named CIS240 in his or her home directory using which of the following commands?

                        a. mkdir ~/cis240                       c. cd /home/verin/cis240

                        b. tar -cf /home/verin/cis240        d. all of the above

14. Which command will run a script named lockup in the background?

                        a. bg lockup                              c. run -b lockup

                        b. lockup &                               d. lockup > bg

15. Which command would search the password file for a user named sargon?

                        a. find sargon in /etc/passwd            c. finduser sargon

                        b. cat /etc/passwd | grep sargon       d. more /etc/passwd -filter sargon

16. Which of these commands will take a user named student01 to his or her home directory?

                        a. cd                                             c. cd ~

                        b. cd /home/student01                     d. all of the above

17. Which of these command will inform the operating system of a job that is to be started at a specific time?

                        a. start                                          c. batch

                        b. at                                             d. delay until

18. The ps command provides information about:

                        a. available Postscript printers           c. active disk partitions

                        b. active processes                         d. mounted peripheral systems

19. Which user categories are NOT recognized by the UNIX permission system?

                        a. owner                                         c. group owner

                        b. administrator                                d. none of the above (ALL are recognized)

20. What is displayed by the top command?

                     a. the most CPU-intensive processes

                       b. directories at the top level of the filesystem

                     c. Letterman's current Top Ten list

                   d. users with the longest login times

II. Short Answer

DIRECTIONS: Type the answer to each question in the blue box associated with it.

21. Write a command which will redirect a long listing of all of the files in the Lecture directory (located in your current working directory) into a file named lecturelist.txt

22. Write a piped command sequence which will display a long directory listing (of your current working directory) one page at a time. (HINT: What command would you use to display the contents of a file one page at a time?)

23. Write a command which will display your current working directory.

24. Write a command which will create a directory named Lectures in your current working directory.

25. Write a command which will remove a directory named Lectures - including any contained files and subdirectories - from your current working directory.

26. Assume you have two directories in your home directory, one named Desktop and the other named CIS240. Also assume you have a file named termproject.ppt in your CIS240 directory. Your current working directory is Desktop. Write a command which will create a symbolic link named slideshow to the termproject.ppt file.

27. Assume there is a command named bigjob.sh available to you (that is, located in your search PATH). Write a command which will start a new bigjob.sh, with lowered priority, in the background.

28. Write a command which will search the manual pages to find commands related to the string "alias".

29. Write a command which will change the name of a file from oldname.txt to newname.txt.

30. Write a command which will display the jobs currently being run by the user.

Part -3:

Discussion

What kinds of activities would you use a job-scheduler for? In your answer, be sure to include a real world example of your activity in your answer. Please be sure to included your cited your source(s) to support your position. Read all postings and respond to at least two other postings, following the guidelines for participation and remember to cite your sources.

Solution Preview :

Prepared by a verified Expert
Operating System: What kinds of activities would you use a job-scheduler for
Reference No:- TGS01374658

Now Priced at $85 (50% Discount)

Recommended (96%)

Rated (4.8/5)