How to run replBatch as Task in Scheduler?

Posted by Valeriy Bashkatov on 21-Jun-2016 02:54

Hello,

I want to write  instructions on how to run replbatch.bat process in Task Scheduler (Windows).

Which settings must be made in the Task Scheduler to run Pro2 Replication correctly?

Are there any tips and best practices?

Regards,
Valeriy

Posted by Bryan Petersen on 21-Jun-2016 11:53

Valeriy,

Here are a few tips and suggestions.  As you look at each tab on the task scheduler setup, the below information will coincide with the selections on the screen.

General Tab:

When setting up a task schedule make sure the user account has system level permissions.  Make sure it will run whether the user is logged on or not.  Also, run with the highest privileges.  The correct permissions are very important to be able to start the task.  Replbatch will write a log to the repl_log directory, so you need to have permissions to that directory.

Triggers Tab:

Set up 2 different triggers on the triggers tab.  First,  "Begin the task" should be "On a schedule" and run it daily to recur every 1 day.  Repeat the task every 1 hour and don't stop the task if it runs for a certain number of days.  Basically you want it to run as long as it can.  You don't want the task to expire and check the enabled box.  

The other trigger is to restart the batch if the machine goes down, so set the task to "At Startup".  The rest of the settings are the same as the first trigger.

Actions Tab:

Add an action to "Start a program".  The "Program/script" box should have the full path and name of the batch file to run; e.g.  C:\Pro2\bprepl\Scripts\replBatch.bat.  In the "Start in" box add the full path; e.g. E:\Pro2_Prod\bprepl\Scripts.

Conditions Tab:

Use the defaults.  No changes needed.

Settings Tab:

Allow the task to be run on demand.  If the task fails, restart every n minutes, n being 10 or 15 minutes depending on what you're comfortable with.  Don't stop the task if it runs longer than a certain time period.  Again, you want to it run all the time.  At the bottom, make sure that the drop down box has “Do not start a new instance”.

These are the settings that are typically used.  I would say the most important is the system level user and permissions for the user.  If I have a problem with the task, most of the time it is related to permissions.  I hope this helps.

Bryan Petersen

All Replies

Posted by Bryan Petersen on 21-Jun-2016 11:53

Valeriy,

Here are a few tips and suggestions.  As you look at each tab on the task scheduler setup, the below information will coincide with the selections on the screen.

General Tab:

When setting up a task schedule make sure the user account has system level permissions.  Make sure it will run whether the user is logged on or not.  Also, run with the highest privileges.  The correct permissions are very important to be able to start the task.  Replbatch will write a log to the repl_log directory, so you need to have permissions to that directory.

Triggers Tab:

Set up 2 different triggers on the triggers tab.  First,  "Begin the task" should be "On a schedule" and run it daily to recur every 1 day.  Repeat the task every 1 hour and don't stop the task if it runs for a certain number of days.  Basically you want it to run as long as it can.  You don't want the task to expire and check the enabled box.  

The other trigger is to restart the batch if the machine goes down, so set the task to "At Startup".  The rest of the settings are the same as the first trigger.

Actions Tab:

Add an action to "Start a program".  The "Program/script" box should have the full path and name of the batch file to run; e.g.  C:\Pro2\bprepl\Scripts\replBatch.bat.  In the "Start in" box add the full path; e.g. E:\Pro2_Prod\bprepl\Scripts.

Conditions Tab:

Use the defaults.  No changes needed.

Settings Tab:

Allow the task to be run on demand.  If the task fails, restart every n minutes, n being 10 or 15 minutes depending on what you're comfortable with.  Don't stop the task if it runs longer than a certain time period.  Again, you want to it run all the time.  At the bottom, make sure that the drop down box has “Do not start a new instance”.

These are the settings that are typically used.  I would say the most important is the system level user and permissions for the user.  If I have a problem with the task, most of the time it is related to permissions.  I hope this helps.

Bryan Petersen

Posted by Valeriy Bashkatov on 22-Jun-2016 02:16

Hi Bryan,

That's what I was looking for.

Thank you very much!

Best regards,

Valeriy

This thread is closed