A system administrator needs to schedule a critical backup script, located at /usr/local/bin/backup.sh, to run automatically at 10:30 PM on the 1st and 15th of every month. Which of the following crontab entries will correctly schedule this task?
The correct answer is 30 22 1,15 * * /usr/local/bin/backup.sh. A crontab entry has five time-and-date fields followed by the command to be run. The fields are in the order: minute, hour, day of month, month, and day of week.
30 specifies the 30th minute.
22 specifies the 22nd hour (10 PM).
1,15 specifies the 1st and the 15th day of the month using a list separator.
The first * is a wildcard for the month field, meaning every month.
The second * is a wildcard for the day of the week field, meaning any day of the week.
The entry * 22 1,15 * * /usr/local/bin/backup.sh is incorrect because the * in the minute field would cause the script to run every minute from 10:00 PM to 10:59 PM on the specified days. The entry 30 22 1-15 * * /usr/local/bin/backup.sh is incorrect because it uses a hyphen, which denotes a range, causing the script to run daily from the 1st through the 15th of the month. The entry */30 22 1,15 * * /usr/local/bin/backup.sh is incorrect because the */30 step value in the minute field would cause the job to run at 10:00 PM and 10:30 PM on the specified days.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is crontab and how is it used?
Open an interactive chat with Bash
What is the meaning of wildcards like `*` and `,` in crontab?
Open an interactive chat with Bash
What is the difference between `1,15` and `1-15` in crontab?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Services and User Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .