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:

  1. Open a terminal window on her RHEL system.
  2. Type crontab -e to edit the current user's crontab file.
  3. If asked to choose an editor, select the editor of her choice (e.g., nano, vi).
  4. 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
  5. Save and exit the crontab file.
  6. 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.

You should also read:

crontab and cron

Bird is a RHEL Sysadmin at Google, a really good one. He is teaching two new hires about cron and crontab. He wants…

cron and crontab

Charlier "Bird" Parker is a genius-level saxophonist who has memorized every Linux command in about 2 hours. After a 10 minute interview at…

/var/log/cron

Sonny Stitt is a phenomenal alto saxophonist by night, and a RHEL Systems Manager at Red Hat (Chicago campus) by day. His teams…

cron 2

Savanna is a RHEL Syadmin at IBM. Her supervisor tell her the write a script to backup /home/savanna/vital_docs to /home/savanna/backup.tar.gz each Sunday at…