How To- Schedule restart of Titan Service

How To- Schedule restart of Titan Service


How To: Schedule restart of Titan Service


Question
Titan memory usage gradually increases over time. How can I restart the service on a scheduled basis?


Reasoning
Over time, a service may gradually consume more memory during continuous operation. Restarting the service on a scheduled basis helps refresh the process and release the used memory without rebooting the server. This can be automated using Windows Task Scheduler with a script that stops and starts the Titan service.


Answer
You can schedule an automatic restart of the Titan service by creating a PowerShell script and configuring Windows Task Scheduler to run the script at a specific time.


Steps


  1. Create a PowerShell script
  1. Create a file named RestartTitanService.ps1 and add the following content:
    Note: For Titan MFT users, the service name is changed from Titan SFTP Server to Titan MFT Server.

$serviceName = "Titan SFTP Server"


Write-Host "Stopping Titan SFTP Server..."

Stop-Service -Name $serviceName -Force


# Wait until service is stopped

$service = Get-Service $serviceName

while ($service.Status -ne 'Stopped') {

   Start-Sleep -Seconds 2

   $service.Refresh()

}


Write-Host "Starting Titan SFTP Server..."

Start-Service -Name $serviceName


Write-Host "Titan SFTP Server restarted successfully." 



  1. Save the script in a directory such as C:\Scripts.
  1. Open Task Scheduler
  1. Press Windows + R
  2. Type taskschd.msc
  3. Press Enter
  1. Create a new task
  1. Click Create Task
  2. Under the General tab:
  3. Enter a task name (e.g., Restart SFTP Server)
  4. Check Run with highest privileges


  1. Set the trigger
  1. Go to the Triggers tab
  2. Click New
  3. Choose when the task should run (for example, Daily at 7:00 AM)
  4. Click OK


  1. Configure the action
  1. Go to the Actions tab
  2. Click New
  3. Select Start a program
  4. In Program/script, enter: powershell.exe
  5. In Add arguments, enter:

    -ExecutionPolicy Bypass -File "C:\Scripts\Restart-TitanSFTP.ps1"

  6. Click OK

  1. Save and test the task

  1. If this appears, you’re all good.
    • Related Articles

    • How To: Manually/Automatically Start Titan Service

      How To: Manually/Automatically Start Titan Service Question The server doesn't start automatically when the PC is booting up. Reasoning The Titan Server may not load automatically after boot due to incorrect service settings, startup errors, or port ...
    • How to create Task Scheduler to automatically restart Titan Service weekly

      Question: How to restart Titan Service Weekly Reasoning: CPU and Memory are spiking and want to restart Titan Service weekly to normalize the resources usage Task Scheduler The Task Scheduler is a Windows component that can automatically run tasks at ...
    • Migrating Titan FTP Server To New Server or VM

      The process to migrate Titan FTP Server from one server (OS) to another server is as follows: 1) Backup (Export) the following Windows Registry data path from the old server (i.e. Titan FTP 2017): Computer\HKEY_LOCAL_MACHINE\SOFTWARE\South River ...
    • Titan Rebranding Announcement – FAQ

      Titan Rebranding Announcement FAQ Overview South River Technologies, Inc. (SRT) has announced a major rebranding initiative to unify its server suite of products under the Titan brand. This change is aimed at driving clarity, enhancing product ...
    • KB PUSH and PULL in Titan MFT Server Next Gen

      PUSH and PULL Automation Events in Titan MFT Server Next Gen Question How do I configure and use the PUSH and PULL capabilities in Events on my Titan MFT server? Pre-requisites: Titan MFT Server Next Gen must be installed on your server system ...