Run bash scripts in Sync Post-Job on Windows

  • 13 May 2024
  • 0 replies
  • 19 views

Userlevel 1
Badge

It is possible to run .sh files via sysExecute in Sync Post-Jobs on a Windows installation of Sync, but you have to install a third party program such as bash or cygwin on your machine, which will allow the Windows OS to be able to run .sh files. For example, I have bash installed on my machine and below is how I can successfully call a .sh script using bash and sysExecute in Sync: 

<api:set attr="sys.name" value="C:\\Program Files\\Git\\bin\\bash.exe" /> 

<api:set attr="sys.arguments" value="C:\\Users\\Public\\Documents\\test.sh" /> 

<api:call op="sysExecute" in="sys" out="result"> 

  <api:set attr="_log.info" value="[result.sys:output]" /> 

</api:call> 

 

Below is my simple .sh script that waits 5 seconds and then just echos "hello world": 

sleep 5  # Waits 5 seconds.  

echo "hello world" 

Which is then logged in the app log, after running the task: 

 

 

 

More details on sysExecute you can find in the following documentation: 

https://cdn.cdata.com/help/AZJ/mft/op_SysExecute.html  

 


This topic has been closed for comments