cancel
Showing results for 
Search instead for 
Did you mean: 

Does Alfresco have a job for cleanup tomcat/temp files?

kodermax
Star Contributor
Star Contributor

Does Alfresco have a job for cleanup tomcat/temp files?

1 ACCEPTED ANSWER

afaust
Legendary Innovator
Legendary Innovator

Alfresco Repository has a job that cleans temporary files that have been created using an Alfresco-specific API (TempFileProvider) for temporary files. This will affect only files in tomcat/temp/Alfresco. The job runs every 60 minutes and cleans all files that are 60 minutes or older. In the worst case, a temporary file may remain there for up to 119 minutes.

Other temporary files are not cleaned up by Alfresco.

View answer in original post

8 REPLIES 8

afaust
Legendary Innovator
Legendary Innovator

Alfresco Repository has a job that cleans temporary files that have been created using an Alfresco-specific API (TempFileProvider) for temporary files. This will affect only files in tomcat/temp/Alfresco. The job runs every 60 minutes and cleans all files that are 60 minutes or older. In the worst case, a temporary file may remain there for up to 119 minutes.

Other temporary files are not cleaned up by Alfresco.

mikel_asla
Star Contributor
Star Contributor

TempFileProvider also allows the creation of "long life folders" that are deleted by default after 24 hours

Can I configure this provider?

Yes,

TempFileProvider is part of alfresco-core (which is not a good name btw for utility classes), that has a inner class defining the Scheduled Job that handles temp files lifecycle. This Job is registered in scheduled-jobs-context.xml so you can override tempFileCleanerTrigger bean to configure it or even change the implementation if you need (sadly, long life folders are not handled by a cronExpression).

afaust
Legendary Innovator
Legendary Innovator

Yeay - answering at the same time. Though my answer starts with the opposite to "Yes", both responses cover the same aspects...

 I guess you understood better the meaning of "Can I configure?" 

erkut3512
Champ in-the-making
Champ in-the-making

yes, they are helping but not that much Smiley Happy

afaust
Legendary Innovator
Legendary Innovator

No, the provider is a static utility without configuration. The only thing you can technically configure is the cleanup process, though there are no reasonable configuration properties you can set via alfresco-global.properties. You'd have to override the default Spring bean definition to change how often the job runs. The long life keep alive is hard-coded, and for the regular temporary file you can only configure the protectHours, e.g. you cannot go below 60 minutes.