keep

  • 27 Jan

    How to keep the most recent files regardless of the creation date?

    Q: Is it possible to create a rule of type: keep the 100 most recent files (regardless of the creation date)?

    A: In version v2024.1.27.0 we added this option for WIN as Source

    • Important, this new option is only available when using our [WIN] as Source (= Windows Folder or Network Share) option:

    limagito file mover windows folder as source

    • Next , select ‘Schedule’ button > ‘Advanced’ Tab:

    The new Skip option is available when the ‘Sort Order’ <> ‘OS Sort Order’

    • Skip none (default) = handle all sorted files found during scan of source folder(s)
    • Skip first x entries in file list = handle all except first x sorted files found during scan of source folder(s)
    • Skip last x entries in file list= handle all except last x sorted files found during scan of source folder(s)

    In the following setup we’ll scan the source folder(s) for files and afterwards we’ll sort them using the last write date (= modified date) from Old to New. When this is done we’ll skip the last 100 entries of this list. The result is that we’ll keep the 100 most recent files in the Source and will not handle (= copy/move/delete) them.

    limagito file mover keep the most recent files

    #managedfiletransfer #filetransfer #filemanagement

    If you need any help with this ‘keep the most recent files’ question, please let us know.

    Best Regards,

    Limagito Team

    By Limagito-Team Filters WIN ,
  • 23 Mar

    Keep a number of files in a specific delete Folder I’m watching in

    Q: Is there any option for a delete rule to keep a number of files, e.g. keep the last 10 Files, in the specific delete Folder I’m watching in?

    We’re trying to handle our LOG Folder with Limagito. These LOG Files are not written permanently within a specific timeslot so it would be great to have this Log Rotation Option. Maybe there is a scriptsolution?

    A: Yes this is indeed possible with Pascal Script (we tested this with version v2022.3.18.0).

    1.Function is set to Delete

    2.Source must be a Windows Folder or share

    3. Set ‘Source File Sort Order’ to ‘File last write date ascending (Old to New)

    Limagito Source File Sort Order

    4.Open Pascal Script setup:

    Limagito File Mover Pascal Script option

    5.Enable and add the following ‘On Destination’ Pascal Script (you can adjust the Const values of ctKeepFiles, ctSearchExt and ctSearchSubDirs):

    Var
      tmpCount: Integer;
    Const
      ctKeepFiles = 10;
      ctSearchExt = '*.log';
      ctSearchSubDirs = True; // True or False
    Begin
      // ... add your code here
      tmpCount := psCountFiles(psFilePath, ctSearchExt, ctSearchSubDirs);
      // Check
      If tmpCount > ctKeepFiles Then
      Begin
        psExitCode := 1;
      End
      Else
      Begin
        psLogWrite(1, '', 'Skip Delete, Minimum count reached');
        psExitCode := -2;
      End;
    End.

    Limagito File Mover keep the last 10 Files

    You’ll find ‘Skip Delete’ in the RunTime Log when the minimum amout of log files needed is reached. Further deletes will be skipped.

    Limagito File Mover RunTime log

    #Filetransfer

    If you need any info about this ‘keep a number of files’ request, please let us know.

    Best regards,

    Limagito Team

    By Limagito-Team Pascal Script ,
SEARCH