1 Reply Latest reply on Apr 17, 2019 4:03 AM by Teodor Doroftei

    Problems with Task Scheduler and Prep

    Teodor Doroftei

      Hello,

       

      I've written a small batch-script to automate the refresh of prep-flows, and the idea was to make windows task scheduler run this script every morning on the server.

      The problem now is that sometimes this just doesn't work, it kind of hangs. The process starts all the sub processes as usual, but when I check it in the morning, the .hyper-files has not been updated and all the processes are kind of idle when checking with process explorer.

      My only option is to kill all those processes and start the script manually, then it works every time.

       

      Here's my batch-script (update_flows.bat):

      @echo off

      for %%a in ("*.tfl") do (

      "C:\Program Files\Tableau\Tableau Prep Builder 2019.1\scripts"\tableau-prep-cli.bat -c "F:\Tableau\Flows_update\credentials.json" -t "F:\Tableau\Flows_update\%%a"

      )

      exit

       

      And here's the setup under Action in the task in Task Scheduler:

      Action:  Start a program

      Program/Script:  C:\Windows\System32\cmd.exe

      Add arguments(optional): /c start "" "F:\Tableau\Flows_update\update_flows.bat"

      Start in(optional):  F:\Tableau\Flows_update

       

      The trigger is set to trigger the task each morning at 07:30.

       

      Another thing that's been bothering me is that the "mother-process" cmd.exe and conhost.exe does not quit after the job is finished, even in those cases where everything went fine and the .hyper-files where updated.

      And for the next time the scheduler starts the whole process again, another copy of the cmd.exe and conhost.exe gets left in memory. I've tried to add a /c flag on the Action in Task Scheduler, but it doesn't seem to help.

       

      Any thought and ideas are much appreciated!

       

      INFO:

      Windows server 2016 (virtual machine)

      Tableau server 2019.1

      Tableau prep 2019.1

       

      //Teo