• Some files not deleted by the 'cleanup local storage' agent

    By Stuart Bogom 5 years ago

    I've noticed that some files are not getting deleted by the 'cleanup local storage' agent. It seems that sometimes the file_ExpiryDate field gets a type of text instead of datetime. When the agent creates a document collection with the following statement, documents with a text value for file_ExpiryDate will not be included, and therefore not processed for possible deletion.

    Set ExpiredColl = thisDatabase.Search(|form=“fm_Files” & file_Storage = “local” & @Date(file_ExpiryDate) < @Date(@Now)|, Nothing, 0)

    I don't know why the value is sometimes text, but this simple change to the collection criteria fixes the problem (notice the addition of @ToTime):

    Set ExpiredColl = thisDatabase.Search(|form=“fm_Files” & file_Storage = “local” & @Date(@totime(file_ExpiryDate)) < @Date(@Now)|, Nothing, 0)