File Mover Blog

  • 08 Dec

    How to email a list of deleted files

    How to email a list of deleted files

    Q: I want to email a list of deleted files on a weekly base. Is this possible with Limagito File Mover.

    A: You could use our ‘Logging to File’ option but in this case the customer wanted a custom list file so we used our scripting option.

    • First you’ll need to setup your delete Rule. We used a Windows Folder as Source:

    limagito file mover Windows folder as source

    • Set Function To ‘Delete Files’:

    limagito file mover list of deleted files

    • Open our ‘Rule Events’ option:

    limagito file mover rule events option

    • Enable ‘On Success’ Event and add the following Pascal Scriptt:
      • do not forget to adjust the ctOutputFile Const
        • We used ‘C:\Test\FileToSend.txt’
    Var
      tmpList: TStringList;
    Const
      ctOutputFile = 'C:\Test\FileToSend.txt';
    Begin
      psExitCode:= 1;
      // ... add your code here
      tmpList := TStringList.Create;
      Try
        Try
          If FileExists(ctOutputFile) Then
            tmpList.LoadFromFile(ctOutputFile)
          Else
            tmpList.Add('Files deleted since ' + FormatDateTime('d mmmm yyyy', Now));          
          // Add Info
          tmpList.Add(FormatDateTime('YYYY/MM/DD HH:NN:SS', Now) + ' Deleted File: ' + psFilePath + psFileName);
          // Save
          tmpList.SaveToFile(ctOutputFile)          
        Except
          psLogWrite(1, '', 'Could not adjust file: ' + ctOutputFile); 
        End;
      Finally
        tmpList.Free;
      End;
    End.
    

    limagito file mover list of deleted files

    • Next add a second Rule which you’ll trigger once a week. Let the second Rule ‘Move’ the create file ‘C:\Test\FileToSend.txt’ (previously defined inthe script of the delete Rule as ctOutputFile) and use SMTP (email) as Destination.
      • We would use our schedule option to move this listing file once a week
        • The example is set to every Monday at 6:00 AM

    limagito file mover schedule option

    If you need any help with this “list of deleted files” question, please let us know.

    Best Regards,

    Limagito Team

    #managedfiletransfer #filetransfer #filemanagement

  • 06 Dec

    How to place zipped files back in their original folders

    How to place zipped files back in their original folders

    Q: Is there a way to place the zipped files back in their original folders? I just want to zip the folders and leave them in their original location. I need to ONLY zip the “ART” folder inside this subfolder. Maybe we could schedule a Remote support session to help me work through it?

    A: This should be possible using our scripting option.

    • As Source we need to add a Windows folder with the following setup:
      • Add %VSA as Source
      • %VSA is a parameter (Var String A) which will contain data from the script that we’ll add in a next step

    limagito file mover Windows folder as source setup

    • Open our Pascal Script option:

    limagito file mover pascal script option

    • Enable and add the following ‘On Rule Begin’ Pascal Script
      • Do not forget to adjust the ctSourceDir Const
      • The ctSoureDir is the directory you want us to scan for ‘Art’ subfolders.
    var
      iList: Integer;
      tmpList1, tmpList2: TStringList;
    Const
      ctSourceDir = 'C:\Test\In_ZIP';
    Begin
      psExitCode:= 0;
      psVSA := '';
      // ... add your code here
      tmpList1 := TStringList.Create;
      tmpList2 := TStringList.Create;
      Try
        tmpList2.StrictDelimiter := True;
        tmpList2.QuoteChar := #0;
        tmpList2.Delimiter := ';';
        psListPaths(ctSourceDir, '*.*', 1, tmpList1);
        For iList := 0 To (tmpList1.Count - 1) Do
        Begin
          psListPaths(tmpList1.Strings[iList], 'Art', 1, tmpList2);
        End;
        // Check
        If tmpList2.Count > 1 Then
        Begin
          psExitCode := 1;
          psVSA := tmpList2.DelimitedText;
          //
          psLogWriteStr('Source folders: ' + psVSA);
        End;
      Finally
        tmpList1.Free;
        tmpList2.Free;
      End;
    End.
    

    limagito file mover on rule begin pascal script

    • Folder structure of our ctSourceDir ( C:\Test\In_ZIP );

    limagito file mover test folder structure

    limagito file mover test folder structure

    limagito file mover test folder structure

    • Filename Exclude Filter Setup (optional):
      • We added *.zip as Filename Exclude Filter since we are placing the created zip file back in the directory which we are scanning for files, just to sure.

    limagito file mover exclude filename filter setup

    • Directory Filter Setup:

    limagito file mover directory filter setup

    • Function Setup:

    limagito file mover function setup

    • ZIP as Destination Setup:

    limagito file mover zip as destination setup

    • Zip as Destination Setup:
      • Zip all files found during scan to a single destination file
      • Adjust zip filename to Zipped-Art
      • Select ‘Add to archive if exists, otherwise create new archive’
      • Add .zip as extension

    limagito file mover zip as destination setup

    • Result after Rule is triggered:

    limagito file mover test folder setup

    If you need any help with this “place zipped files back” question, please let us know.

    Best Regards,

    Limagito Team

    #zip #managedfiletransfer #filetransfer #filemanagement

    By Limagito-Team ZIP
  • 06 Dec

    Advanced Moving Rule Temporary Directory Option

    Advanced Moving Rule Temporary Directory Option

    Q: Regarding the temporary folder.  This location, that I’m going to change it to a new D:, but just curious, what happens if this location does fill up.  What happens to the job that’s running and using it?

    limagito file mover moving rule advanced setup

    • Temporary Directory Option:
      • This folder is uses as temporary storage between Source and Destination. Each Rule uses multiple threads so we can handle Source and Destination files at the same time. Never use a network folder as Temporary Directory.
      • This option needs to be set for each Rule separately

    limagito file mover temporary directory option

    A: It will give an OS error because we are not able to write the stream from the source to this temporary directory. To prevent it from filling up you could enable the on error event and send an e-mail if something goes wrong.

    Q: Will enable the event. I’am using AWSS3 as Source but don’t have any control over how much data they put in that S3 bucket, if there is 1 TB of files and the d: drive is only 100 GB, does Limagito just divide that up in to manageable chunks based on the free space of the D: drive?  I know the first iteration of the job was close to 1 TB and the drive is only 100 GB, but it succeeded.

    A: That is because the temp files were moved to the destination. Multiple threads are working at the same time getting files from the Source and moving them to their Destination (s). You could enable our precondition and check the free size of the D drive. Then you would set the max files for a single scan to for example 50 files or more so it would recheck the free space every 50 files.

    limagito file mover precondition option

    • Enable ‘Check Free Disk Space’. In this example:
      • scanning of source files would be allowed when free disk space on Y:\ is more than 15%
      • scanning of source files would be skipped when free disk space on Y:\ is 10% or lower

    limagito file mover precondition setup

    • Schedule Setup > Advanced Tab > Max. Files processed in Once Scan is set to 50 as an example
      • Each scan will handle 50 files and will check the precondition first

    limagito file mover max files processed

    If you need any help with this “temporary directory” question, please let us know.

    Best Regards,

    Limagito Team

    #managedfiletransfer #filetransfer #filemanagement

    By Limagito-Team How-to
1 2 3 4 5 6 7 8 151
SEARCH