Solved

Job not running External Executable

  • 12 July 2023
  • 2 replies
  • 85 views

Badge

Hi all!

We have created an external executable to run a python script, basically looking like this:

 

cd F:\Data\
Start-Process python GetData.py
exit

Next we have added this to an execution package. If we run the package it will open a prompt and run the python script no problem.

However if we add the package to a job and schedule or manually run that job nothing happens. How can we get this to work?

cheers,

Maarten

icon

Best answer by Bitmetric_Maarten 13 July 2023, 15:12

View original

2 replies

Userlevel 6
Badge +5

Hi @Bitmetric_Maarten 

When you manually run the execution package, it is the user that is currently logged into TimeXtender that opens the prompt and runs the script. When the script is run through a scheduled job it TimeXtender Execution Service user that opens the prompt and runs the script. Can you please check that the Execution Service user has the required permissions to access and run the python script?

Badge

Thank you for the answer. The rights for Python where there, however the service account needed admin rights to be able to delete the old files in the map. Changing that made it work.

We also made an improvement in the executable:

$job = Start-Job { python "C:\source\Test\wait.py" }
Wait-Job $job
Receive-Job $job

Without this it will start and immediately end the Job execution, while the Python script will keep running in the background. This means that if you have your jobs chained you might miss data or run into errors because of that. Script above fixes that.

Reply