Page 1 of 1
Configure a profile to run on schedule but wait if another profile is running, and folder monitoring in Linux
Posted: Wed Feb 19, 2025 8:16 pm
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?
Re: Configure a profile to run on schedule but wait if another profile is running, and folder monitoring in Linux
Posted: Wed Feb 19, 2025 8:35 pm
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.
Re: Configure a profile to run on schedule but wait if another profile is running, and folder monitoring in Linux
Posted: Wed Feb 19, 2025 10:42 pm
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;
Re: Configure a profile to run on schedule but wait if another profile is running, and folder monitoring in Linux
Posted: Wed Feb 19, 2025 11:49 pm
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.
Re: Configure a profile to run on schedule but wait if another profile is running, and folder monitoring in Linux
Posted: Thu Feb 20, 2025 3:39 am
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?
Re: Configure a profile to run on schedule but wait if another profile is running, and folder monitoring in Linux
Posted: Thu Feb 20, 2025 11:03 am
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.