• Document are not deleted after expiration date.

    By Steve Dionne 1 decade ago

    in the about screen you say:

    "The link is valid for a set number of days and after that the file is removed from the system saving you disk space by not having it stored in a users sent box."

    Is there an option that need to be enable? Look like that agent to remove document after the expiration date has not been done yet.

    You had a very good idea!

    Congratulation for the good work already done…

    • Document are not deleted after expiration date.

      By jive king 1 decade ago

      This is under the section "known issues".

      The agent to delete expired downloads has not been written yet.

      I don't think it would take much to create the agent(s). You could have a field "expired" that would be updated by a daily agent, then create a view for documents that are "expired". Another agent could run after the first one that would purge documents in said view.

      • Here's a basic daily purge agent

        By Jeffery A Lay 1 decade ago

        Here's a simple LotusScript agent to zap expired documents daily. I haven't bugtested it extensively, but as a basic dumb daily purge it should be fine. Don't forget to comment out the actual deletion line while testing thoroughly if you decide to use this, or if you've changed selection criteria, or data loss could result. Printed progress updates are written to the standard output (Notes status line, or server log).

        It could be a lot smarter if needed, but it's a start. Use as you see fit.


        Agent: "Purge expired files"

        Created Jul 5, 2010 by Jeff Lay/mcs/UK

        Description: Basic unsmart deletion. Goes through file attachment documents and deletes any

        which have an expiry date before today (but not today!)

        Run this on a daily schedule at one minute past midnight for automated cleanup.

        %END REM

        Option Public

        Option Declare

        Sub Initialize()

        Dim nsSession As New NotesSession

        Dim ndbDatabase As NotesDatabase

        Set ndbDatabase = nsSession.CurrentDatabase

        ' Create a collection of file attachment documents with expiry dates before today's date

        Dim ndcExpiredFiles As NotesDocumentCollection

        Set ndcExpiredFiles = ndbDatabase.Search("@Date(file_ExpiryDate) < @Date(@Now)", Nothing, 0)

        ' Loop through the collection

        Dim ndDocument As NotesDocument, ndDocToDelete As NotesDocument

        Dim intDocCount As Integer

        intDocCount = 0

        Print "FileSender: Purging expired documents."

        Set ndDocument = ndcExpiredFiles.Getfirstdocument()

        While Not (ndDocument Is Nothing) ' If there are documents, perform the following steps

        ' Do it this way, because you can't select the next doc (which is based on the current doc)

        ' if the current doc has just been deleted.

        intDocCount = intDocCount + 1

        Set ndDocToDelete = ndDocument ' Prepare to delete the document

        Set ndDocument = ndcExpiredFiles.Getnextdocument(ndDocument) ' Prepare the next step in the loop

        Print "Purging expired doc with subject '" + CStr(ndDocToDelete.GetItemValue("file_Subject")(0)) + "', from " + CStr(ndDocToDelete.GetItemValue("file_Sender")(0)) + "."

        ndDocToDelete.Remove(False) ' Delete the prepared document

        Wend ' When there are no documents remaining to delete, exit the loop.

        Print "Purged " + CStr(intDocCount) + " expired documents."

        End Sub