File Mover Blog

  • 03 Oct

    Looking for a File Mover Software to accomplish Archiving task

    Q: Looking for Software to accomplish Archiving task.

    Details: Looking for product that we can schedule to look at multiple project folders within a base directory, if no files have been modified in X days within a project folder, then move (copy/delete) that whole project directory and files to another server/CIFS location. Even better if that product can append a string (like date) to the moved project folder for reference ( if possible append 10_02_2020 to end of projectX folder name). Essentially we want to automate archiving data from expensive location/storage to cheap location/storage.

    A: In version v2020.10.3.0 we added some Pascal Script functions to achieve this request.

    What we will do is:
    – Scan base directory for project folders (1 level deep) using Pascal Script
    – Scan each project folder we found for the youngest filedate
    – If youngest filedate in this folder is older than x days then we add this folder to a parameter (%VSA)
    – At the end we provide this parameter (%VSA) as WIN Source. This parameter can containe multiple project folders.
    – The renaming of the Destination will be done in the WIN Destination Setup with a little help of Pascal Script

    Some screenshots to get you started:

    >Please Select WIN as Source and change the ‘Select Directory’ to %VSA.

    So as you see the WIN as Source will NOT be your project base folder! Parameters in LimagitoX File Mover start with %. %VSA stands for Variable String A. %VSA can be used at different places in the rule setup. In this case %VSA will get its value using Pascal Script.


    LimagitoX File Mover WIN as Source

    > Select ‘Pascal Script’ Setup in the ‘Moving Rule’ menu:

    LimagitoX Pascal Script

    >Enable and add the following ‘On Rule Begin’ Pascal Script:

    Important, change the following Const in the Pascal Script:

    • ctSourcePath = ‘C:\Test\In\’;
    • ctOlderThanInDays = 1000;

    ctSourcePath is the base directory of your Project Folders.

    ctOlderThanInDays is set to 1000. So in this case the youngest file should be older then 1000 days before we move the project folder and its content.

    Var
      iPath: Integer;
      tmpFileDate: TDateTime;
      tmpFileName: String;
      tmpPath: String;
      tmpPaths: TStringList;
    Const
      ctSourcePath = 'C:\Test\In\';
      ctOlderThanInDays = 1000;
    Begin
      // Init Var
      psExitCode:= 0;
      psVSA := '';
      // ... add your code here
      psLogWrite(1, '', 'PS Source File Path: ' + ctSourcePath);
      tmpPaths := TStringList.Create;
      Try
        // psListPaths(Directory: String; DirectoryFilter: String; DirectoryLevel: integer; Var Paths: TStringList);
        psListPaths(ctSourcePath, '*', 1, tmpPaths);
        psLogWrite(1, '', 'PS Folders Found: ' + tmpPaths.Text);
        // Iterate
        For iPath := 0 To (tmpPaths.Count-1) Do
        Begin
          tmpPath := tmpPaths.Strings[iPath];
          // psGetYoungestFilename(Directory: String; FilenameFilter: String; IncludeSubDirectory: boolean): String;
          tmpFileDate := psGetYoungestFileDate(tmpPath, '*.*', True);
          If tmpFileDate <> 0 Then
          Begin
            // Debug Info
            tmpFileName := psGetYoungestFilename(tmpPath, '*.*', True);
            psLogWrite(1, '', 'PS Youngest Filename Found: ' + tmpFileName + ' in ' + tmpPath);
            // Check Date
            If tmpFileDate < (Now - ctOlderThanInDays) Then
            Begin
              // Add Patht to psVSA Param
              If psVSA = '' Then
                psVSA := tmpPath + ';'
              Else
                psVSA := psVSA + tmpPath + ';';
            End;
          End;
        End;
        // Debug Info
        psLogWrite(1, '', 'PS Path Count: ' + IntToStr(tmpPaths.Count));
      Finally
        tmpPaths.Free;
      End;
      // Check Result
      If psVSA <> '' Then
      Begin
        psLogWrite(1, '', 'Pascal Script psVSA Result: ' + psVSA);
        psExitCode := 1;
      End
      Else
        psVSA := 'C:\NonExistingPath\';
    End.
    

    >Enable and add the following ‘On Destination’ Pascal Script

    Important, change the following Const in the Pascal Script:

    • ctSourcePath = ‘C:\Test\In\’;

    ctSourcePath is the base directory of your Project Folders. Must be exactly the same as in the previous ‘On Rule Begin’ Pascal Script.

    This Pascal Script will strip the root part of the Project Folder and set it to %VSB. We’ll use %VSB later for adding the date as requested to the root folder of the project.

    LimagitoX Pascal Script On Destination

    Const
      ctSourcePath = 'C:\Test\In\';
    Begin
      psExitCode:= 1;
      // ... add your code here
      psVSB := psStringReplace(psSourcePath, ctSourcePath, '');
      psVSB := psStringReplace(psVSB, '\', '');
      psLogWrite(1, '', 'psVSB: ' + psVSB);
    End.
    

    >Select ‘Add WIN’ in the Destination Setup:

    LimagitoX File Mover Select Destination

    >Select your Destination folder (= where to move the project folders to):

    LimagitoX File Mover WIN as Destination

    >Enable and set ‘Create Subdir, opt.’ to:  %VSB_%TCD:MM_DD_YYYY:\%SFS

    LimagitoX File Mover Subdir option

    > Function setup, please leave the Function to ‘Copy Files’ during your tests. If everything is ok then you can change it to ‘Move Files’.

    LimagitoX File Mover Function Setup

    > Done

    If you need any help with this Archiving task setup, please let us know.

    Best Regards,

    Limagito Team

  • 27 Sep

    REST as Source was added to LimagitoX File Mover

    REST as Source was added in LimagitoX File Mover version v2020.9.27.0

    This was done on request by a customer who wanted to use our File Mover to download HL7 results using REST.

    LimagitoX File Mover REST as Source

    In the screenshot we seleceted ‘Quest HL7 Results’ as Web Service API and added the Request Url:

    The JSON Request field stays empty, this is only used when you select Custom as Web Service API.

    LimagitoX File Mover REST Setup

    Don’t forget to add the Acknowledgment Url (not the same as the Request Url):

    LimagitoX File Mover REST Ack Setup

    REST Security Setup:

    LimagitoX File Mover REST Security Setup

    REST Common options:

    LimagitoX File Mover REST Common options

    REST RunTime Log

    LimagitoX File Mover REST RunTime Log

    If you need any help with the REST as Source option, please let us know. We are interested in adding your ‘custom’ REST API.

    Best regards,

    Limagito Team

    By Limagito-Team HL7 REST ,
  • 02 Sep

    Second FTP Vendor option was added in LimagitoX File Mover

    A second FTP vendor was added in LimagitoX File Mover version v2020.9.2.0. This second FTP vendor is also based in the USA and has a long history with providing API’s for many internet protocols. The reason we did this is because there are quite some different FTP servers out there and it seems we couldn’t cover them all. With a second vendor we try to minimize this. The second FTP vendor supports TLS1.3 (Security Tab – Select ‘Automatically TLS’).

    Switching can be done on the fly. Default is still the original vendor (Vendor 1 – SB) which we are using for quite some time now. This new option is available under the ‘Setup’ tab of your FTP setup. Feedback experience about using the new vendor would be much appreciated.

    LimagitoX File Mover FTP Second Vendor

    If you need any help , please let us know.

    Best Regards,

    Limagito Team

    By Limagito-Team FTP , ,
1 75 76 77 78 79 80 81 136
SEARCH