Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to schedule a job to run every minute.
Linux CLI
* * * * [1] /path/to/script.sh Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '0' in the last field runs only on Sunday.
Using '1' or '5' restricts the job to specific weekdays.
✗ Incorrect
The last field in a cron expression is the day of the week. Using '*' means every day of the week, so the job runs every minute of every day.
2fill in blank
mediumComplete the code to schedule a job to run at 3 AM every day.
Linux CLI
0 [1] * * * /path/to/script.sh
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Setting hour to 0 runs at midnight, not 3 AM.
Using 12 runs at noon, not 3 AM.
✗ Incorrect
The second field is the hour. Setting it to '3' means the job runs at 3 AM.
3fill in blank
hardFix the error in the cron expression to run a job every Sunday at midnight.
Linux CLI
0 0 * * [1] /path/to/script.sh
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '*' runs the job every day, not just Sunday.
Using '1' runs the job on Monday.
✗ Incorrect
In cron, Sunday can be represented as 0 or 7. Using '0' is standard and avoids confusion.
4fill in blank
hardFill both blanks to schedule a job to run every 15 minutes between 9 AM and 5 PM on weekdays.
Linux CLI
[1] 9-17 * * [2] /path/to/script.sh
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '*' in minutes runs every minute, not every 15 minutes.
Using '0' in day of week runs only on Sunday.
✗ Incorrect
Using '*/15' in the minutes field runs the job every 15 minutes. '1-5' in the day of week field means Monday to Friday.
5fill in blank
hardFill all three blanks to schedule a job to run at 30 minutes past every hour from 8 AM to 10 AM on the 1st and 15th of each month.
Linux CLI
[1] [2] 1,15 * [3] /path/to/script.sh
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '*' in hours runs every hour, not just 8 to 10.
Using '1-5' in day of week restricts to weekdays, which is not needed here.
✗ Incorrect
The minutes field is '30' for 30 minutes past the hour. The hour field is '8-10' for 8 AM to 10 AM. The day of week field is '*' to run on any day of the week since days are restricted by day of month.