back to labs
Schedule a Daily Backup with cron
MediumRHCSA Prep10-15 minThe brief
A backup script /opt/backup.sh must run automatically every day at 2:30 AM. Add a cron entry for it.
The cleanest place for a system job is a drop-in under /etc/cron.d/ — a plain text file whose lines carry SIX fields (a username between the schedule and the command):
# minute hour day-of-month month day-of-week user command
30 2 * root /opt/backup.sh
Write that into /etc/cron.d/backup. The schedule '30 2 *' means minute 30, hour 2, every day/month/weekday. (A user crontab entry — same 5 time fields, no username — is also accepted.) Grading reads the cron configuration.
What you'll do
- Schedule /opt/backup.sh to run daily at 02:30 via a cron entry
Hands-on lab: you work on a real Linux box in your browser, graded on the machine's actual state.
