Using lr_cron within Cron
Prev | Chapter 4. Using DLF Stores | Next

## Using lr_cron within Cron

To actually execute all that is configured in the Dlf Store, you need to run the lr_cron command at regular interval.

Installing cron jobs is really easy since the only parameters given to lr_cron are a `period` and a `store`. The lines to add to your crontab should look similar to:

    0 * * * * /usr/bin/lr_cron hourly /var/lib/lire/my_store
    0 1 * * * /usr/bin/lr_cron daily /var/lib/lire/my_store
    0 2 * * 0 /usr/bin/lr_cron weekly /var/lib/lire/my_store
    0 3 1 * * /usr/bin/lr_cron monthly /var/lib/lire/my_store
    0 4 1 1 * /usr/bin/lr_cron yearly /var/lib/lire/my_store

You should configure one job for each different period you use. You can also configure it for all period since nothing will be done when there are no scheduled actions to execute.

### Note

You should take care to setup the time at which the lr command is executed so that it makes sense in regards of your log rotation scheme. For example, if you run the daily schedule at 1AM but you rotate your daily logs at 2AM, lr_cron will act upon the data of two days ago instead of on the data of the previous day.

Prev | Up | Next
Report Jobs | Home | Report Configurations