File Mover Blog

  • 09 Jan

    Q&A 40: Is it possible to create a file timestamp monitor job

    Q: Is it possible to create a file timestamp monitor job. I mean, is there a way to setup a job that states that if there has not been a file with a timestamp of less than say 2 hours to send an alarm?

    A: Yes this is possible. We added some screenshots to get you started.

    • Be sure the Function is set to ‘Copy Files’ (which is default).

    Limagito File Mover Function Setup

    • Please add the directory you want to monitor as WIN Source. In our example we’ll use ‘C:\Test\In\’.

    Limagito File Mover Source Selection

    • We are going to monitor .pdf files in this example so we added  *.pdf  as Filename Include Filter.

    Limagito File Mover Filename Filter Setup

    • Our goal is to check if there are files available younger than 2 hours:

    Limagito File Mover Filedate Filter Setup

    • As Destination we added a simple Pascal Script to give us some information:

    Limagito File Mover Destination Selection

    Begin
      psExitCode:= 1;
      // ... add your code here
      psLogWrite(1, '', 'File Found: ' + psFilePath + psFileName);
    End.
    

    Limagito File Mover Pascal Script

    • Next step is to setup the ‘On No File Found’ Rule Event:
      • Enable ‘On No File Found’ Rule Event
      • Enable Mail
      • Setup Mail Message
      • Setup Common SMTP (Server which will send the Mail Message)

    Limagito File Mover Rule Events

      • Mail Message Setup

    Limagito File Mover Email Setup

      • Setup Common SMTP (Server which will send the Mail Message). We are using the Google SMTP to send the Mail Message.

    Limagito File Mover SMTP Server Setup

    • We added a Pascal Script which will add information in the log when the event is triggered.
    Begin
      // ... add your code here
      psLogWrite(1, '', 'We did not find any file younger than 2 hours');
    End.
    

    Limagito File Mover Rule event Pascal Script

    • If you don’t want to send the email event ‘On No File Found’ with each scan then please enable ‘Error event Memory’ in the Options Tab. When this option is enable AND ‘No File Was Found’ then we’ll send the email only once. The ‘Error Event Memory’ will reset itself when a file was found again.

    • RunTime Log Result when no file younger than 2 hours was found:

    Limagito File Mover RunTime Log Result

    • Email Result when no file younger than 2 hours was found:

    Limagito File Mover Email Message

    If you need any help with this ‘file timestamp monitor’ request, please let us know.

    Best Regards,

    Limagito Team

    By Limagito-Team Q&A WIN ,
  • 09 Jan

    Q&A 39: Is it possible to setup a wildcard config for source directories?

    Q: I was curious if it is possible to setup a wildcard config for source directories.  In this example, folders with media are created every January 1st.  I like the source path to be something like \\MyServer\MyShare\media\202*  , essentially only looking for folders with a year of 2020 or greater.

    A: Yes this is possible. Could you please try:

    – Setup WIN as Source folder. Directory: \\MyServer\MyShare\media\
    Limagito File Mover WIN as Source
    (ignore the red text, it’s just an example)
    Limagito File Mover WIN as Source Setup
    – Add the following Directory Filter Setup:
    We’ll exclude files in the base folder (\\MyServer\MyShare\media\)
    Limagito File Mover Directory Filter Setup
    We added a Subdirectory Include Name Filter:
    Limagito File Mover Directory Filter Setup
    Important, we’ll also exclude subfolders of invalid Subdirectories.
    Limagito File Mover Directory Filter Advanced Setup
    Feedback user: Thank you. This seems to work.
    If you need any help with this ‘wildcard config for source directories’ request, please let us know.

    Best Regards,

    Limagito Team

    By Limagito-Team Q&A WIN , ,
  • 30 Dec

    Q&A 38: I would like to log the create date of the file being moved

    Q: I would like to log the create date of the file being moved. Can you please advise if there is a way filemover can be setup to log the create date of the file being moved. As of now we don’t see this info in the log file. Is there a setting in the app that we can tweak to control what all is logged in the log file?
    A: We added some extra Pascal Script functions in version v2020.12.30.0 to achieve this.

    Please open the Pascal Script option of your Rule:

    Limagito File Mover Pascal Script option

    Enable and Add the following ‘On Destination’ Pascal Script:

    Var
      tmpDateTime: TDateTime;
      tmpDateStr: String;
    Begin
      psExitCode:= 1;
      
      // Creation Time
      tmpDateTime := psGetCreationTime(psFilePath + psFileName);
      tmpDateStr := FormatDateTime('YYYY-MM-DD HH:NN:SS', tmpDateTime);
      psLogWrite(1, '', 'Creation Time of ' + psFilePath + psFileName + ': ' + tmpDateStr);
      
      // Creation Time Utc
      tmpDateTime := psGetCreationTimeUtc(psFilePath + psFileName);
      tmpDateStr := FormatDateTime('YYYY-MM-DD HH:NN:SS', tmpDateTime);
      psLogWrite(1, '', 'Creation Time Utc of ' + psFilePath + psFileName + ': ' + tmpDateStr);
      
      // Last Access Time
      tmpDateTime := psGetLastAccessTime(psFilePath + psFileName);
      tmpDateStr := FormatDateTime('YYYY-MM-DD HH:NN:SS', tmpDateTime);
      psLogWrite(1, '', 'Last Access Time of ' + psFilePath + psFileName + ': ' + tmpDateStr);
      
      // Last Access Time Utc
      tmpDateTime := psGetLastAccessTimeUtc(psFilePath + psFileName);
      tmpDateStr := FormatDateTime('YYYY-MM-DD HH:NN:SS', tmpDateTime);
      psLogWrite(1, '', 'Last Access Utc Time of ' + psFilePath + psFileName + ': ' + tmpDateStr);
      
      // Last Write Time
      tmpDateTime := psGetLastWriteTime(psFilePath + psFileName);
      tmpDateStr := FormatDateTime('YYYY-MM-DD HH:NN:SS', tmpDateTime);
      psLogWrite(1, '', 'Last Write Time of ' + psFilePath + psFileName + ': ' + tmpDateStr);
      
      // Last Write Time Utc
      tmpDateTime := psGetLastWriteTimeUtc(psFilePath + psFileName);
      tmpDateStr := FormatDateTime('YYYY-MM-DD HH:NN:SS', tmpDateTime);
      psLogWrite(1, '', 'Last Write Utc Time of ' + psFilePath + psFileName + ': ' + tmpDateStr);
    End.
    

    Limagito File Mover Pascal Script Get Creation Time

    RunTime Log Result:

    Limagito File Mover RunTime log

    In the example we added ‘Creation Time (Utc)’, ‘Last Access Time (Utc)’ and ‘Last Write Time (Utc)’. You can, of course, remove the parts you do not need from the Pascal Script.

    If you need any help with this ‘log the create date’ request, please let us know.

    Best Regards,

    Limagito Team

    By Limagito-Team Pascal Script Q&A
1 77 78 79 80 81 82 83 145
SEARCH