AWS Thinkbox Discussion Forums

Automatic job cleanup set via Maxscript?

Hello,
I have built a custom deadline submitter in Maxscript (using Deadline 10.1.30.3, 3dsMax 2021, Vray5)
Everything works well, but now I would like to add an option for the job to autodelete once complete after 1 day.
I found a reference to such a deadline setting in a super old Deadline User Manual, Release 7.1.0.35
• OverrideAutoJobCleanup=<true/false>
• OverrideJobCleanup=<true/false>
• JobCleanupDays=<true/false>
• OverrideJobCleanupType=<ArchiveJobs/DeleteJobs>

Ignoring the typo for the days (should be a number instead of true/false), is all this deprecated as I can’t access via SMTDsettings, nor SMTDFunctions?
If it is deprecated, how else could I add this feature?

Many thanks!
Graham

Hello @GrahamMac

I do not think you can use the deprecated functions unless you are using the correct version. There is a cleanup feature in Deadline which can be set to autodelete/archive jobs after 1 - X number of days. It can be configured from Deadline Monitor> Tools> Configure Repo Options> Job Settings> Cleanup:

More info here.

Thank you. Zainali!

It is good to know this can be changed in the repository.
I was aiming at a more user customisable approach though.

Every user, submitting jobs, can set the cleanup on their job after submission from their DL monitor, however, I was seeing if I could expose this parameter from my submitter script in Max, for convenience. It would make it quicker to adjust, and remind the user that the the job is set to cleanup after X days.

If the cleanup parameters can be set in DL monitor per job by the user, this data must be stored somewhere per job, (maybe in a re-writable text file!! :slight_smile: ).
I tried to find this without luck! :frowning:

Hey,

The setting I referred to in my last response is global, which means once it is set it will be setup for every job. However this setting can be overridden per job basis from Job’s Right menu> Modify Job Properties> Cleanup. Then the House Cleaning process will perform cleanup based on the settings. House Cleaning Interval (time between two House Cleaning processes) can also be customized.

You cannot set cleanup at the time of submission from the submission script unless you changes to Max scripts. I have very less knowledge of max script. You need to have following key/values in JobInfo parameter of your job.

https://docs.thinkboxsoftware.com/products/deadline/10.2/1_User%20Manual/manual/manual-submission.html#cleanup

So max script needs to be customized where it creates a job info file.

Hi Zainali,

Thank you for highlighting this!
I will investigate modifying the job info file at the point just before it gets copied to farm.
I’ll post back here if I get anywhere with it! :slight_smile:

1 Like

I got it working!! :slight_smile:
Thanks again Zainali!!

Code:

 SMTDFunctions.CreateSubmitInfoFile SubmitInfoFile
 TheSubmitFile = openfile SubmitInfoFile mode:"a+" --opens TheSubmitFile as a filestream in read-write append to end mode
 format "\nOverrideAutoJobCleanup=true" to:TheSubmitFile
 format "\nOverrideJobCleanup=true" to:TheSubmitFile
 TheJobCleanupDays = ("\nJobCleanupDays=" + UserChosenCleanupDays as string)
 format "%"TheJobCleanupDays to:TheSubmitFile
 format "\nOverrideJobCleanupType=DeleteJobs" to:TheSubmitFile
 close TheSubmitFile
 --proceed to submit job as usual
1 Like

@GrahamMac

This is awesome!! Thanks for sharing. I will register this internally as a solution for similar issues in the future.

Privacy | Site terms | Cookie preferences