Chapter 2. Automatically Synchronizing the Red Hat Satellite Server Repository
cronutility to effectively automate synchronization.
Procedure 2.1. To Use the cron Utility to Automate Synchronization:
- Switch to the root user, and run the following command to open the
crontabin a text editor:
# crontab -e
- Create a suitable job definition to schedule the synchronization. To create a random synchronization time, use the following entry:
0 1 * * * perl -le 'sleep rand 9000' && satellite-sync --email >/dev/null 2>1This entry runs the synchronization job randomly between 01:00 and 03:30, and discards
stderrmessages from the
cronutility. This prevents duplicating messages from the
satellite-synccommand. Other options can be included as needed. See the
man crontabfor more information.
- Exit the text editor to save the updated
crontabfile. The new rules take effect immediately.
crontabfile opens in vi by default. To change this behavior, change the
EDITORvariable to the name of the text editor you prefer.