121k views
3 votes
You are editing the crontab file and want an entry to run every hour at five minutes past the hour. Which of the following entries will accomplish this task?

a. 5 * * * * /home/emmett/
b. * 5 * * * /home/emmett/
c. * *5 * * /home/emmett/
d. * * * 5 * /home/emmett/

1 Answer

6 votes

Final answer:

The correct crontab entry to run a command every hour at five minutes past the hour is 'a. 5 * * * * /home/emmett/'. This specifies the job should run every hour at the fifth minute.

Step-by-step explanation:

To set up a crontab entry to run every hour at five minutes past the hour, the correct syntax should specify the minute, hour, day of the month, month, day of the week, and the command to be executed. Looking at the options provided:

  • a. 5 * * * * /home/emmett/
  • b. * 5 * * * /home/emmett/
  • c. * *5 * * /home/emmett/
  • d. * * * 5 * /home/emmett/

The correct entry is:

a. 5 * * * * /home/emmett/

The first position in the crontab format represents minutes, the second represents hours, and the asterisks (*) work as placeholders, meaning 'every'. Therefore, '5 * * * *' specifies that the job should run at 5 minutes past every hour, on every day, every month, and every day of the week.

User Barakisbrown
by
7.9k points