Require number of files

English Support for Syncovery on Windows.
Post Reply
katie83
Posts: 4
Joined: Wed Nov 17, 2021 3:25 pm

Require number of files

Post by katie83 »

Is there a way to require a set number of files? I created a task to move files from one directory to another directory. However, I do not want Syncovery to move any files if I don't have the correct number of files (14). So if Syncovery does not detect 14 files, I do not want it to run. I checked the box to "Copy Only 14 Files per run" but this is not a required count and it does not prevent Syncovery from running when there are less than 14 files.

tobias
Posts: 1603
Joined: Tue Mar 31, 2020 7:37 pm

Re: Require number of files

Post by tobias »

Hello,
right now it's not possible but I will add a PascalScript hook for you so the validity of the profile actions can be verified before letting it perform them.

tobias
Posts: 1603
Joined: Tue Mar 31, 2020 7:37 pm

Re: Require number of files

Post by tobias »

Hello,
you will now find the new version 9.40beta1 on our download page. It allows you to use the following PascalScript. The profile will only enter the main action phase if there are exactly 14 files to be copied (or moved) from left to right.

Code: Select all

function OnBeforeMainActionPhase(const CopyL2RCount,CopyR2LCount,DeleteLCount,DeleteRCount,MoveLCount,MoveRCount:Int64;
                                 const CopyL2RBytes,CopyR2LBytes,DeleteLBytes,DeleteRBytes,MoveLBytes,MoveRBytes:Int64):Boolean;
begin
  if CopyL2RCount=14 then
     Result:=true
  else begin
    Result:=false;
    Log('Not continuing because CopyL2RCount is '+IntToStr(CopyL2RCount));
    end;
  end;
This can be entered when editing a profile in Advanced Mode, via the Job tab sheet and the "Pascal Script" checkbox.

For more information about PascalScript, please see:
https://www.syncovery.com/pascalscript/

Post Reply