Alfresco Trashcan Cron Not Working

cancel
Showing results for 
Search instead for 
Did you mean: 
suayb58
Active Member

Alfresco Trashcan Cron Not Working

Hello,Everyone.i want to delete trashan every 30 minute using trashcan cron.i pasted that in alfresco.properties file:

trashcan-cleaner.cron=0 0/30 * * * ?

trashcan cron is starting.but no files in trash can be deleted.alfresco.log record in alfresco.log:

2018-08-19 22:56:00,051 DEBUG [org.alfresco.trashcan.TrashcanCleaner] [DefaultScheduler_Worker-2] Running TrashcanCleaner
2018-08-19 22:56:00,082 DEBUG [org.alfresco.trashcan.TrashcanCleaner] [DefaultScheduler_Worker-2] Found 11 nodes on trashcan
2018-08-19 22:56:00,082 DEBUG [org.alfresco.trashcan.TrashcanCleaner] [DefaultScheduler_Worker-2] Number of nodes to delete: 0
2018-08-19 22:56:00,082 DEBUG [org.alfresco.trashcan.TrashcanCleaner] [DefaultScheduler_Worker-2] Nodes deleted
2018-08-19 22:56:00,082 DEBUG [org.alfresco.trashcan.TrashcanCleaner] [DefaultScheduler_Worker-2] TrashcanCleaner finished

number of deletes is 0.but it found 11 nodes on trashan.why these nodes are not being deleted? How can I solve this problem?

5 Replies
hardik1512
Established Member II

Re: Alfresco Trashcan Cron Not Working

Hi,

The nodes might not be getting deleted as they dont pass the criteria of daysToKeep parameter.

You can configure this param to tell cleaner about number of days deleted docs to be kept in trash can. For e.g. if you configure it as 7, it will remove content from the trashcan and mark them as orphan if a content has been in the trashcan for more than 7 days.

To delete from the trashcan without waiting any grace period set the trashcan.daysToKeep property value to -1.

Hope this helps!!!

suayb58
Active Member

Re: Alfresco Trashcan Cron Not Working

I added this criteria in alfresco global properties.trashcan cron is starting.but no files in trash can be deleted again .

added criteria in alfresco-global.properties file

trashcan-cleaner.cron=0 0/4 * * * ?
trashcan.daysToKeep=-1

log record in alfresco.log

2018-08-21 16:24:00,107 DEBUG [org.alfresco.trashcan.TrashcanCleaner] [DefaultScheduler_Worker-4] Running TrashcanCleaner
2018-08-21 16:24:00,155 DEBUG [org.alfresco.trashcan.TrashcanCleaner] [DefaultScheduler_Worker-4] Found 11 nodes on trashcan
2018-08-21 16:24:00,156 DEBUG [org.alfresco.trashcan.TrashcanCleaner] [DefaultScheduler_Worker-4] Number of nodes to delete: 0
2018-08-21 16:24:00,156 DEBUG [org.alfresco.trashcan.TrashcanCleaner] [DefaultScheduler_Worker-4] Nodes deleted
2018-08-21 16:24:00,159 DEBUG [org.alfresco.trashcan.TrashcanCleaner] [DefaultScheduler_Worker-4] TrashcanCleaner finished

hardik1512
Established Member II

Re: Alfresco Trashcan Cron Not Working

trashcan-cleaner.keepPeriod : Specifies the period for which trashcan items are kept (in the java.time.Duration format).

You can try P-1D OR -P1D. Is this doesn't work, you need to do some research for specifying in duration format.

suayb58
Active Member

Re: Alfresco Trashcan Cron Not Working

Thanks,i  tried -P1D. this criterion works fine.

Fameur2019
Member II

Re: Alfresco Trashcan Cron Not Working

Hi there, 

I tried the same thing in galfresco-global.properties

trashcan-cleaner.cron=0 0/5 * * * ?
trashcan-cleaner.keepPeriod=P1D
trashcan-cleaner.deleteBatchCount=1000

with my dockerized Alfresco 6

but nothing happens   the cron doesn't fire 

can you help ??