Configure a profile to run on schedule but wait if another profile is running, and folder monitoring in Linux

English Support for Syncovery on Linux etc.
Post Reply
IMTheNachoMan
Posts: 140
Joined: Sun Nov 20, 2022 5:11 am

Configure a profile to run on schedule but wait if another profile is running, and folder monitoring in Linux

Post by IMTheNachoMan »

I have two questions.
  • I know we can have one profile run after another profile using Execute Command or Script before/after.... If I have two profiles both set to run every 30 minutes, sometimes one profile will take longer. So how can I tell the 2nd profile to pause/wait until the first profile is done running.
  • In Linux, how can I have it monitor files/folders for changes and run after 30 seconds, instead of running on set schedule?
tobias
Posts: 1933
Joined: Tue Mar 31, 2020 7:37 pm

Re: Configure a profile to run on schedule but wait if another profile is running, and folder monitoring in Linux

Post by tobias »

Hello,
please see the "OnCanRunProfile Sample Script" on our PascalScript page:
https://www.syncovery.com/pascalscript/

Folder Monitoring is not available in the Linux version of Syncovery because Linux does not provide a suitable API for recursive monitoring.

There's only non-recursive, and that's not great. I may be able to find a solution some time in the future.
IMTheNachoMan
Posts: 140
Joined: Sun Nov 20, 2022 5:11 am

Re: Configure a profile to run on schedule but wait if another profile is running, and folder monitoring in Linux

Post by IMTheNachoMan »

tobias wrote: Wed Feb 19, 2025 8:35 pm Hello,
please see the "OnCanRunProfile Sample Script" on our PascalScript page:
https://www.syncovery.com/pascalscript/

Folder Monitoring is not available in the Linux version of Syncovery because Linux does not provide a suitable API for recursive monitoring.

There's only non-recursive, and that's not great. I may be able to find a solution some time in the future.
Got it. Thank you.

If I have 4 profiles, and I don't want P1/P2 to run if P2/P1 is running, and/or P3/P4 to run if P4/P3 is running, then would this script work:

Code: Select all

const p1='Profile Name 1';
      p2='Profile Name 2';
      p3='Profile Name 3';
      p4='Profile Name 4';

function OnCanRunProfile(const ProfileName:UnicodeString; var PostponeBySeconds:Integer):Boolean;
begin
    if ProfileName=p1 then
        Result:=not ProfileRunning(p2)
    else
        if ProfileName=p2 then
            Result:=not ProfileRunning(p1)
        else
            if ProfileName=p3 then
                Result:=not ProfileRunning(p4)
            else
                if ProfileName=p4 then
                    Result:=not ProfileRunning(p3)
                else
                    Result:=true;
    
    if not Result then
        PostponeBySeconds:=60;
end;
tobias
Posts: 1933
Joined: Tue Mar 31, 2020 7:37 pm

Re: Configure a profile to run on schedule but wait if another profile is running, and folder monitoring in Linux

Post by tobias »

Hi,
yes the script looks great!

The only limitation with PascalScripts is that they don't run under ARM64 CPUs. I hope I can implement the CPU specific code for ARM64 sometime this year.
IMTheNachoMan
Posts: 140
Joined: Sun Nov 20, 2022 5:11 am

Re: Configure a profile to run on schedule but wait if another profile is running, and folder monitoring in Linux

Post by IMTheNachoMan »

Out of curiosity, will the Maximum simultaneously running jobs (profiles): setting work as I'm thinking in that only one profile will run and other profiles will wait until it is done before starting?

Meaning, if I set this to 1 then I wouldn't need the script, right?
tobias
Posts: 1933
Joined: Tue Mar 31, 2020 7:37 pm

Re: Configure a profile to run on schedule but wait if another profile is running, and folder monitoring in Linux

Post by tobias »

Hello,
yes, if you set the maximum simultaneous jobs to 1, then you won't need the script.

But the functionality is slightly different, as the script would allow profiles 1 and 3 to run together, as well as 2 and 4 etc.
Post Reply