The correct crontab entry to execute the script chklog three times per month between 3 p.m. and 5 p.m.:

The correct crontab entry to execute the script chklog three times per month between 3 p.m. and 5 p.m.:

A. * 3,4,5 1 * * chklog

B. 3 3,4,5 1 * * chklog

C. 3 15,16,17 * * * chklog

D. 0 15,16,17 1 * * chklog

E. * 15,16,17 1 * * chklog

Answer: C

Explanation:

The correct crontab entry to execute the script chklog three times per month between 3 p.m. and 5 p.m. is:

3 15,16,17 * * * chklog

The crontab entry has five fields that specify the time and frequency of the job, followed by the command or script to be executed.

The fields are:

Minute: the minute of the hour when the job should run, from 0 to 59

Hour: the hour of the day when the job should run, from 0 to 23 (in 24-hour format)

Day of month: the day of the month when the job should run, from 1 to 31

Month: the month of the year when the job should run, from 1 to 12

Day of week: the day of the week when the job should run, from 0 to 6 (where 0 and 7 are Sunday) The asterisk (*) means any value, and the comma (,) means a list of values.

Therefore, the crontab entry above means:

Run the job at the 3rd minute of the hour

Run the job at the 15th, 16th, and 17th hour of the day (which are 3 p.m., 4 p.m., and 5 p.m.)

Run the job on any day of the month

Run the job on any month of the year

Run the job on any day of the week

This will execute the script chklog three times per day, every day of the month, and every month of the year, which is equivalent to three times per month. The other options are incorrect because:

A. This will run the job at any minute of the hour, but only at the 3rd, 4th, and 5th hour of the day (which are 3 a.m., 4 a.m., and 5 a.m.), and only on the 1st day of the month.

B. This will run the job at the 3rd minute of the hour, but only at the 3rd, 4th, and 5th hour of the day (which are 3 a.m., 4 a.m., and 5 a.m.), and only on the 1st day of the month.

D. This will run the job at the 0th minute of the hour (which is the top of the hour), but only at the 15th, 16th, and 17th hour of the day (which are 3 p.m., 4 p.m., and 5 p.m.), and only on the 1st day of the month.

E. This will run the job at any minute of the hour, but only at the 15th, 16th, and 17th hour of the day (which are 3 p.m., 4 p.m., and 5 p.m.), and only on the 1st day of the month.

Reference: Crontab Explained in Linux [With Examples]

‘crontab’ in Linux with Examples – GeeksforGeeks

Linux Crontab Command Help and Examples – Computer Hope Crontab in Linux with 20 Useful Examples to Schedule Jobs – TecAdmin Linux crontab tutorial with Examples – Linux Tutorials – Learn Linux …

Latest 102-500 Dumps Valid Version with 194 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments