Question 4: Sun Certified System Administrator

Posted on
Share on Google+Share on LinkedInShare on FacebookShare on RedditTweet about this on TwitterEmail this to someone

Objective:

Manage Network Printers and System Processes
SubObjective:

Control system processes by viewing the processes, clearing frozen processes, and scheduling automatic one-time and recurring execution of commands using the command line

Single Answer, Multiple Choice

You add the following command line entry in a crontab file:

20 22 5 6,12 * /ftphome/dbinput/db_upload

Which statement is true for the given entry?

A. The /ftphome/dbinput/db_upload script will run at 10:20 P.M. on every Friday and Saturday.

B. The /ftphome/dbinput/db_upload script will run at 8:22 P.M. on the sixth and twelfth day of May.

C. The /ftphome/dbinput/db_upload script will run at 10:20 P.M. on the fifth day of June and December.

D. The /ftphome/dbinput/db_upload script will run at 8:22 P.M. on all days of May and June.

Answer:
C. The /ftphome/dbinput/db_upload script will run at 10:20 P.M. on the fifth day of June and December.

Tutorial:
The /ftphome/dbinput/db_upload script will run at 10:20 P.M. on the fifth day of June and December. The syntax of a crontab file entry is <minute> <hour> <day of the month> <month of the year> <day of the week> <command> . The <minute> field can hold values from 0 to 59, the <hour> field can hold values from 0 to 23, the <day of the month> field can hold values from 1 to 31, the <month of the year> field can hold values from 1 to 12, and the <day of the week> field can hold values from 0 to 6, where 0 represents Sunday. Any of these five fields can be an asterisk indicating all valid values. Also, any field can be a list of values separated by commas. The last field <command> specifies the command to be executed by the shell at the specified time. In the given entry, the <minute> field is 20 and the <hour> field is 22. This indicates a time of 10:20 P.M. The <day of the month> field is 5, which indicates the fifth day of a month. The <month of the year> field is 6,12, which indicates the months June and December. Therefore, the /ftphome/dbinput/db_upload script will run at 10:20 P.M. on the fifth day of June and December.

The /ftphome/dbinput/db_upload script will not run on every Friday and Saturday. The <day of the week> field is the fifth field in a crontab file entry. In the given entry, this field contains an asterisk. This means the /ftphome/dbinput/db_upload script can run on any or all days of a week.

The /ftphome/dbinput/db_upload script will not run at 8:22 P.M. on the sixth and twelfth day of May. The <minute> field is the first field and the <hour> field is the second field in a crontab file entry. In the given entry, the <minute> field is 20 and the <hour> field is 22. This indicates a time of 10:20 P.M. The <day of the month> field is the third field. In the given entry, this field is 5, which means the fifth day of a month. The <month of the year> field is the fourth field. In the given entry, this field is 6,12, which indicates the months June and December. Therefore, the /ftphome/dbinput/db_upload script will run at 10:20 P.M. on the fifth day of June and December.

The /ftphome/dbinput/db_upload script will not run at 8:22 P.M. on all days of May and June. The <minute> field is the first field and the <hour> field is the second field in a crontab file entry. In the given entry, the <minute> field is 20 and the <hour> field is 22. This indicates a time of 10:20 P.M. The <day of the month> field is the third field. In the given entry, this field is 5, which means the fifth day of a month. The <month of the year> field is the fourth field. In the given entry, this field is 6,12, which indicates the months June and December. Therefore, the /ftphome/dbinput/db_upload script will run at 10:20 P.M. on the fifth day of June and December.

Reference:
Solaris 10 System Administrator Collection, System Administration Guide: Advanced Administration, Chapter 15 Scheduling System Tasks (Tasks), Scheduling a Repetitive System Task (cron), http://docs.sun.com/app/docs/doc/817-0403/6mg741c0s?a=view.

Solaris 10 Reference Manual Collection, man pages section 1: User Commands, User Commands, crontab(1) user crontab file, http://docs.sun.com/app/docs/doc/816-5165/6mbb0m9dq?a=view.

Share on Google+Share on LinkedInShare on FacebookShare on RedditTweet about this on TwitterEmail this to someone
cmadmin

ABOUT THE AUTHOR

Posted in Archive|

Comment:

Leave a comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>