Scheduling
-
- Posts: 1
- Joined: Mon Sep 06, 2021 6:59 pm
Scheduling
I would be nice if you could schedule a start and end time on each day of the week ie i would like to stop the bkup on sat at noon but run it until 7:30 on week days I have not been able to come with a workaround of how to do it as of this time i bkup data on the hour for quit a group of profiles 6 and a half days a week but not on sat afternoon and sun
Re: Scheduling
Hello,
for this use case, please specify the normal time window for weekdays in the profile.
Then go to the Program Settings dialog, tab sheet "Advanced", and use the Global PascalScript button to add this script:
for this use case, please specify the normal time window for weekdays in the profile.
Then go to the Program Settings dialog, tab sheet "Advanced", and use the Global PascalScript button to add this script:
Code: Select all
function OnGetNextRunTime(const LastRun, ProposedNextRun: Double): Double;
begin
// Check if the proposed next run is on a weekend after 12 PM
if (DayOfTheWeek(ProposedNextRun) >= 6) and (ProposedNextRun - Trunc(ProposedNextRun) >= 0.5) then
begin
// Move to next Monday at 7:30 AM
Result := Trunc(ProposedNextRun) + 8 - DayOfTheWeek(ProposedNextRun) + (7.5 / 24);
end
else
begin
// Otherwise, return the proposed next run time as is
Result := ProposedNextRun;
end;
end;