AWS Thinkbox Discussion Forums

PreTaskScript to check output path

Hello ,

I am having this issue. I want to create a PreTaskScript that checks the ouput path of the job before each task starts and delete any junk files that may be there. (the files are .lock files that i need to get rid of before the task starts) My problem is how to i make the script connect to our repo and deadline and get the ouputpath of said job.

How do pretaskscripts work in Deadline sine I find very few examples of how they are setup to be honest.

Thank you

I don’t have a pre-task script for you, but here’s a quick template for a post-job script. I’m guessing they are pretty similar:

from System.IO import *
from Deadline.Scripting import *

def __main__( *args ):
    deadlinePlugin = args[0]
    job = deadlinePlugin.GetJob()
    outputDirectories = job.OutputDirectories
    outputFilenames = job.OutputFileNames

    # Make magic here

yeah I have seen this before, and I am trying to go by this.

I am interested in seeing the differences and how pre-task scripts work since I can’t find ant examples of them anywhere

so what i did so far is managed to get the job id from the environment variables. Now i want to use it to open a the ouput folder of that job and scan for a specific file everytime before a task starts. The problem is that i can’t get to import anything from deadline in the script so how will it know which path to open and search

Also getting the TaskId in order to associate it with the file is proving to be a lot more difficult than i thought.

Privacy | Site terms | Cookie preferences