From the course: Red Hat Certified System Administrator (EX200) Cert Prep: 1 Deploy, Configure, and Manage (2021)

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Manage reccuring system jobs with cron

Manage reccuring system jobs with cron

- [Instructor] A recurring system task is not tied to a user and is run by the operating system. The format of a system cron job is the same as a user cron job. System cron jobs are stored in /etc/cron.d. To create a cron job we'll need to create a new file inside of this directory. Since we're creating a system cron job we'll need to elevate privileges with sudo. In a terminal type in sudo vi /etc/cron.d/backupdocs and hit enter. Go into insert mode by pressing the I key and then add in 0 1 * * * root rsync -a /home/user1/Documents/ /home/user1/Documents.bak. This cron job looks very similar to a user cron job with a couple of differences. After the time specification we've included a user to run this as. In this case, the user is root. We've also included absolute paths for the source and destination files to ensure the correct files get copied. Any user can be specified to run system cron jobs. If you use a normal…

Contents