Bird
0
0

After adding this line in crontab -e:

medium📝 Command Output Q13 of 15
Linux CLI - Cron and Scheduling
After adding this line in crontab -e:
0 0 * * 0 /home/user/backup.sh
What will happen?
AThe script runs every day at midnight.
BThe script runs every Sunday at midnight.
CThe script runs every hour on Sundays.
DThe script runs once a month at midnight.
Step-by-Step Solution
Solution:
  1. Step 1: Decode the cron schedule

    Fields: minute=0, hour=0, day-of-month=*, month=*, day-of-week=0. Day-of-week 0 means Sunday.
  2. Step 2: Interpret the schedule

    The script runs at 00:00 (midnight) on every Sunday.
  3. Final Answer:

    The script runs every Sunday at midnight. -> Option B
  4. Quick Check:

    0 0 * * 0 = Sunday midnight [OK]
Quick Trick: Day-of-week 0 means Sunday in cron [OK]
Common Mistakes:
  • Thinking it runs daily instead of weekly
  • Confusing day-of-month with day-of-week
  • Assuming 0 means Monday

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes