cancel
Showing results for 
Search instead for 
Did you mean: 

Reclaim Space

ale_carraro
Champ in-the-making
Champ in-the-making
Today I noiced something strange.
I had a very big file in the repository (it was a full export of the spaces store, so it was nearly 1GB). After download, I deleted it, and removed it also from the 'trash'.

Now, the entry in the DB is gone (I did the following in the DB:
SELECT * FROM ALF_NODE_PROPERTIES WHERE
STRING_VALUE LIKE '%contentUrl=store://2009/7/2%'

but the file is still there.

So my question is: is it possible to scan the alf_data in search of deleted files (files present in the content folder, but not in any repository) and remove them? Is there a standard procedure to follow?

tanks in advance

Alex
8 REPLIES 8

schminkel
Champ in-the-making
Champ in-the-making
Hi Alex,

after you have deleted the file from the trash, the file is still in the content-store until the "ContentStoreCleaner
Job" has been triggered.
This job moves the files from the "contentstore" to "contentstore.deleted" where you need to delete them manually.

In a default configuration this job is not configured. Thus you need to add this job-trigger to a *context.xml.

e.g.
     <bean id="contentStoreCleanerTrigger" class="org.alfresco.util.CronTriggerBean">
        <property name="jobDetail">
            <ref bean="fileContentStoreCleanerJobDetail" />
        </property>
        <property name="scheduler">
            <ref bean="schedulerFactory" />
        </property>
        <!– trigger at 22:05 each day –>
        <property name="cronExpression">
            <value>0 5 22 * * ?</value>
        </property>
    </bean>

I hope this helps.

Thorsten

ale_carraro
Champ in-the-making
Champ in-the-making
Thanks for your reply. I'm not sure though if I got it right.

What happens when delete a document? I thought that the workflow was the following:

1) When I click on the trash icon in the web UI, the document (the node and the actual file) was moved to the "contentstore.deleted" store
2) When I go to the "user options">"management">"Manage Deleted Items">"Delete Listed Items" the node from "contentstore.deleted" and the relative file were deleted permanently from the store and the filesystem

What I've seen is that the node in the repository has been deleted, but not the (huge) .bin file in the filesystem (which is still located in the "contentStore")


What you suggest is that if I delete a file, it is 'marked deleted' but still in the contentStore. This sound strange, because deleting if from the trashcan Alfresco warns:
Are you sure you want to permanently delete the following deleted files and spaces from the deleted file store? The items cannot be recovered once this action has been performed.

Suggesting that the file is already in the deleted store

May be the delete moves only the node and not the file, and the file is moved by the job you were referencing? Still strange, because I've got many files in the "contentstore.deleted" directory and you stated that the job is off by default…

Thank you very much, I will still try your solution. Keep in touch


Alex

kbonnet
Champ in-the-making
Champ in-the-making
Hi Alex,

The job "fileContentStoreCleanerJobDetail" is supposed to perform the deletion from file system. the deleted content store is an Alfresco store, just like the "spaces store" for active documents.

If you configure the job, deleted files will also be deleted from file system.

Koen

schminkel
Champ in-the-making
Champ in-the-making
Hi Alex, when you delete a file in Alfresco and do a trash cleaning afterwards, this only affects the database. Nothing is moved to the "contentstore.deleted". Only the cleaner job will move deleted files to the "contentstore.deleted".

To make sure everything is deleted, you need to do all steps in this order:
1. delete file in alfresco
2. clean trash of alfresco
3. run cleaner job
4. delete the contentstore.deleted (folder)

Cheers, Thorsten

manju
Champ in-the-making
Champ in-the-making
Hi All,

I am not able to recover the space after deleting the files from Alfresco GUI even after configuring contentStoreCleaner. Can somebody help me on this. Below is my configured details.

entry in content-services-context.xml

   <bean id="contentStoreCleaner" class="org.alfresco.repo.content.cleanup.ContentStoreCleaner" init-method="init">
      <property name="protectDays" >
         <value>${system.content.orphanProtectDays}</value>
      </property>
      <property name="deletionFailureAction" >
         <value>${system.content.deletionFailureAction}</value>
      </property>
      <property name="eagerContentStoreCleaner" >
         <ref bean="eagerContentStoreCleaner" />
      </property>
      <property name="jobLockService">
         <ref bean="jobLockService" />
      </property>
      <property name="contentDataDAO">
           <ref bean="contentDataDAO"/>
      </property>
      <property name="dictionaryService">
         <ref bean="dictionaryService" />
      </property>
      <property name="contentService" >
         <ref bean="contentService" />
      </property>
      <property name="avmNodeDAO">
            <ref bean="newAvmNodeDAO"/>
      </property>
      <property name="transactionService" >
         <ref bean="transactionService" />
      </property>
   </bean>

…………………….

   <bean id="eagerContentStoreCleaner" class="org.alfresco.repo.content.cleanup.EagerContentStoreCleaner" init-method="init">
      <property name="eagerOrphanCleanup" >
         <value>${system.content.eagerOrphanCleanup}</value>
      </property>
      <property name="stores" ref="contentStoresToClean" />
      <property name="listeners" >
         <ref bean="deletedContentBackupListeners" />
      </property>
   </bean>


Entry in scheduled-jobs-context.xml

    <bean id="contentStoreCleanerJobDetail" class="org.springframework.scheduling.quartz.JobDetailBean">
        <property name="jobClass">
            <value>org.alfresco.repo.content.cleanup.ContentStoreCleanupJob</value>
        </property>
        <property name="jobDataAsMap">
            <map>
                <entry key="contentStoreCleaner">
                    <ref bean="contentStoreCleaner" />
                </entry>
            </map>
        </property>
    </bean>
    <bean id="contentStoreCleanerTrigger" class="org.alfresco.util.CronTriggerBean">
        <property name="jobDetail">
            <ref bean="contentStoreCleanerJobDetail" />
        </property>
        <property name="scheduler">
            <ref bean="schedulerFactory" />
        </property>
        <property name="cronExpression">
            <value>${system.content.orphanCleanup.cronExpression}</value>
        </property>
    </bean>

…………………………………..


system.content.eagerOrphanCleanup=true
system.content.orphanProtectDays=0
system.content.deletionFailureAction=IGNORE
system.content.orphanCleanup.cronExpression=0 0/2 * * * ?

Please help me.

manju
Champ in-the-making
Champ in-the-making
In the last post xml entries got missed. I am trying to re-post it.

<!– Performs the content cleanup –>
   <bean id="contentStoreCleaner" class="org.alfresco.repo.content.cleanup.ContentStoreCleaner" init-method="init">
      <property name="protectDays" >
         <value>${system.content.orphanProtectDays}</value>
      </property>
      <property name="deletionFailureAction" >
         <value>${system.content.deletionFailureAction}</value>
      </property>
      <property name="eagerContentStoreCleaner" >
         <ref bean="eagerContentStoreCleaner" />
      </property>
      <property name="jobLockService">
         <ref bean="jobLockService" />
      </property>
      <property name="contentDataDAO">
           <ref bean="contentDataDAO"/>
      </property>
      <property name="dictionaryService">
         <ref bean="dictionaryService" />
      </property>
      <property name="contentService" >
         <ref bean="contentService" />
      </property>
      <property name="avmNodeDAO">
            <ref bean="newAvmNodeDAO"/>
      </property>
      <property name="transactionService" >
         <ref bean="transactionService" />
      </property>
   </bean>

manju
Champ in-the-making
Champ in-the-making
Hi Can somebody help with the issue I am facing. I am new to Alfresco. I have deleted quite a few files from GUI and they are available in the ManageDeletedItems. I need to delete them through backend (by schedulers) for which I made orphanProtectDays=0 so that it will move to contentstore.deleted by contentstorecleaner. But files are still exist in the ManageDeletedItems only.

Please some let me know what I am missing here.

dmsalf2014
Champ in-the-making
Champ in-the-making
You need to check three settings in repository.properties file

system.content.eagerOrphanCleanup=true
system.content.orphanProtectDays=0
System.content.orphanCleanup.cronExpression=0 30 14 * * ?

these settings will automatically delete the files as soon as you cleared from the ManageDeletedItems