Ensure Tetra Agent Services Run Constantly

To ensure that a Tetra Agent's services run constantly, you can add a Windows Schedule Task to automatically restart the Tetra Agent service on a daily basis at a specific time (for example, schedule to run at 1:00 AM). If the Tetra Agent service is already running when the scheduled task executes, it will not impact the Tetra Agent service.

This page describes how to:

  • Create a batch file to start the Tetra Agent
  • Create a task to run the batch file
  • Edit or delete a task using a Windows Schedule Task

Create a Batch File to Start the Tetra Agent

To create a batch file that starts the Tetra Agent automatically:

  1. Open the Windows Services panel and locate the Tetra Agent service you want to start.
    Tetra Agent services use this naming convention: TetraScience.Agent.AgentType.AgentVersion.(Instance:AgentId)
  2. Right-click the Agent service and select Properties.

Windows Services panel

  1. Copy the Tetra Agent service name displayed in the Service name field, for example: TetraScience.Agent.file-log.v3.4.0$7abaa520-726d-4182-9e17-8c830f29ae0e. You will use this service name to create a batch file in Step 4.

General tab showing Service name

  1. Using a shell program, create a batch file to start and run the Tetra Agent service. In this example, replace the <agent_service_name> with the Tetra Agent service name (TetraScience.Agent.file-log.v3.4.0$7abaa520-726d-4182-9e17-8c830f29ae0e) you copied previously in Step 3.
net start "<agent_service_name>"
  1. Save the batch file to a folder, for example: C:\TetraScience\TetraScience.Agent.File-Log.v3.4.0\. When you save the batch file name, you should use a descriptive name, such as restart_agent.bat.


Batch File Name Extensions

Batch file names may include these file extensions: .bat, .cmd, or .btm.

  1. Close the Services panel.

Create a Task to Run the Batch File

To create a task to run the batch file:

  1. From the Windows Task Scheduler, select Action and then select Create Basic Task.
  2. Add a Name and Description for the task, and then click Next.
  3. Select Daily and then click Next.
  4. Indicate the Start Date, Time, and Recurrence, and then click Next.
  5. Navigate to and select the batch file that you created previously, and then click Next.
  6. Review the task information, and click Finish.

Edit or Delete a Task Using Windows Schedule Task

After you have created a scheduled task, you can edit or delete the task.
From the Windows Schedule Task:

  • To edit the task: Right-click and select Properties. Edit and save the updated task information.
  • To delete the task: Right-click and select Delete.