AWS Thinkbox Discussion Forums

Clean up exported files upon render

I’d love to see an option to clean up the export files .ass, .ifd, .vrscene, .rib, .rs, etc. once an export and render job has been completed, if it can verify the frame has been rendered and then delete that file it rendered from.

Does anyone have any post job scripts that run and do this? Or have a smarter way to clear up the masses of data that end up on the server?

1 Like

Deadline has cleanup events. We use these for some cleanup, though we’d like to implement more.

(put in repo/custom/plugins/IntermediateFilesCleanup/)
(simplified)

class IntermediateFilesCleanupListener(DeadlineEventListener):
...
    jobs = RepositoryUtils.GetJobsInState(
                ["Suspended", "Completed", "Failed"])
    for job in jobs:
        # (here do some checks on the job parameters, the files, etc.)
        # ...
        shutil.rmtree(job.JobOutputDirectories[0])

There is a bit of documentation on them in the Events section. They are triggered periodically on workers.

1 Like
Privacy | Site terms | Cookie preferences