cron
Delta is a RHEL Sysadmin at IBM. She has written a script called backup.sh. She wants to create a cron job to run the script at 4 PM every Wednesday, 2 PM every Sunday, and at 7 PM the 3rd Friday of every month. Please list all of the commands that she'll have to execute on her RHEL system.
To create a cron job to run the backup.sh script at specific times, Delta will need to use the crontab
command. She will need to execute the following steps:
- Open a terminal window on her RHEL system.
- Type
crontab -e
to edit the current user's crontab file. - If asked to choose an editor, select the editor of her choice (e.g., nano, vi).
- Add the following lines to the crontab file:
- 0 16 * * 3 /path/to/backup.sh # 4 PM every Wednesday
0 14 * * 0 /path/to/backup.sh # 2 PM every Sunday
0 19 15-21 * 5 /path/to/backup.sh # 7 PM on the 3rd Friday of every month
- 0 16 * * 3 /path/to/backup.sh # 4 PM every Wednesday
- Save and exit the crontab file.
- Verify that the crontab entry was added correctly by typing
crontab -l
. This should list all of the current user's cron jobs.
Note: Delta should replace /path/to/backup.sh
with the actual file path to her backup script. Also, make sure that the script is executable by running chmod +x /path/to/backup.sh
if it is not already executable.