-
Notifications
You must be signed in to change notification settings - Fork 7
Schedule
The log shipping service works by looping through all the databases in parallel (Limited by MaxThreads) then waiting a period of time to start the next iteration. You can control the delay between iterations with DelayBetweenIterationsMs. If a single database has a large volume of log backups to restore it could delay the start of the next iteration. The MaxProcessingTimeMins can be used to control the maximum amount of time to spend processing log restores for a single database.
LogShippingService.exe --PollForNewDatabasesFrequency 10 --DelayBetweenIterationsMs 10000 --MaxProcessingTimeMins 60
"Config": {
"PollForNewDatabasesFrequency" : 10,
"DelayBetweenIterationsMs": 10000,
"MaxProcessingTimeMins": 60,
If you want more control over when log restores run. e.g. On the hour, every hour, use the LogRestoreScheduleCron instead of DelayBetweenIterationsMs. Also use PollForNewDatabasesCron instead of PollForNewDatabasesFrequency" if you want to use a cron schedule for new database initialization.
LogShippingService.exe --LogRestoreScheduleCron "0 * * * *" --PollForNewDatabasesCron "0 * * * *"
"Config": {
"LogRestoreScheduleCron": "0 * * * *",
"PollForNewDatabasesCron": "0 * * * *",
This project uses Cronos to calculate the next run date from the cron expression.
The log shipping service will look for log backups created after the last restored backup. It's possible that timezone differences could cause issues where we have to process additional log files or it starts processing log files that are too recent.
LogShippingService.exe --OffsetMins 0
"Config": {
"OffsetMins": 0,
Note: If the log files are too recent, the log shipping service with automatically try adjusting the date by 1hr then by 1 day.
The Hours option can be used to exclude certain hours. The example below excludes 9-16 so log shipping will be paused between 9:00 and 16:59. This is useful if you are using the Standby option and need the database to be available during certain times of the day.
LogShippingService.exe --Hours 0 1 2 3 4 5 6 7 8 17 18 19 20 21 22 23
"Config": {
"Hours": [0, 1, 2, 3, 4, 5, 6, 7, 8, 17, 18, 19, 20, 21, 22, 23],
To reset to all:
LogShippingService.exe --Hours 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
or
LogShippingService.exe --Hours -1