Scheduled tasks start 6 hours late

Psiax 21 Reputation points
2021-10-04T19:25:19.88+00:00

Issue
Two scheduled tasks set to start at 11:30pm both started at 5:30am, the next morning. Looking for a reason why this might happen. Perhaps something related to time zones?

Background
This is regarding the home version of W10.

I have two scheduled tasks. FYI they make backups for my computer - one for changes and one to mirror all files under \users\folder.

These ran successfully for years on my old computer and I just setup these same tasks on a new one.

I am in US Eastern timezone (+5:00).

Resources
I attached the XML file of one task. I edited it to anonymize the Author (\computer name\account), and UserID.

Sorry - don't have scheduler history. Forgot to activate it until today.

Also:
Bonus points if you can also tell me why these tasks took 3 hours to complete when they typically took minutes on the older and MUCH slower computer.

Thank you!

Caveat
Sorry if I entered "tags" that meaningless. I have no idea what the available tags are, and which ones would be relevant to my issue. I originally posted this on the MS Community but was asked to post it here, so I am probably in the wrong place.


<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2021-10-03T10:12:06.1982993</Date>
<Author>COMPUTERNAME\ACCOUNT</Author>
<URI>\BACKUP-Mirror</URI>
</RegistrationInfo>
<Triggers>
<CalendarTrigger>
<StartBoundary>2021-10-03T23:30:00</StartBoundary>
<Enabled>true</Enabled>
<ScheduleByDay>
<DaysInterval>1</DaysInterval>
</ScheduleByDay>
</CalendarTrigger>
</Triggers>
<Principals>
<Principal id="Author">
<UserId>S-1-1-11-111111111-111111111-111111111-1111</UserId>
<LogonType>S4U</LogonType>
<RunLevel>HighestAvailable</RunLevel>
</Principal>
</Principals>
<Settings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>true</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<IdleSettings>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>false</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>
<UseUnifiedSchedulingEngine>true</UseUnifiedSchedulingEngine>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>P1D</ExecutionTimeLimit>
<Priority>7</Priority>
</Settings>
<Actions Context="Author">
<Exec>
<Command>C:\BackupTools\MirrorBackup.cmd</Command>
</Exec>
</Actions>
</Task>

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,606 questions
Windows 10 Setup
Windows 10 Setup
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
1,901 questions
0 comments No comments
{count} votes

Accepted answer
  1. MotoX80 31,571 Reputation points
    2021-10-11T21:31:27.043+00:00

    I modified a test VM that I had to sleep after 3 minutes. In doing that I noticed an "Allow wake timers" option. In control panel, check your pc to see if it's set to enable.

    139604-capture.jpg

    In the task settings I unchecked the first 2 items under Power, and selected Wake the computer to run this task.

    See if that works for you.

    139575-capture4.jpg

    Update: It worked when I set the task to run with my Admin account and with a "normal" Testuser account. And with no one logged on to the desktop.


10 additional answers

Sort by: Most helpful
  1. Andreas Baumgarten 96,281 Reputation points MVP
    2021-10-04T19:40:50.623+00:00

    Hi @Psiax ,

    have you tried the option Synchronize across time zones?

    137532-image.png

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    0 comments No comments

  2. MotoX80 31,571 Reputation points
    2021-10-04T23:46:21.66+00:00

    Bonus points if you can also tell me why these tasks took 3 hours to complete

    Without knowing what you have in C:\BackupTools\MirrorBackup.cmd I will have to refer to my Magic Crystal Ball, but sadly it has dead batteries at the moment.

    The first step would be to capture stdout/stderr to see if whatever program you are running is spitting out error messages. Set the task to run cmd.exe and set the arguments to capture the output.

    cmd.exe /c C:\BackupTools\MirrorBackup.cmd 1>C:\logs\MirrorBackup.log 2>&1  
    

    The obvious culprit would be something network related. Your best bet is to trace whatever program you are running with Process Monitor and look for big time gaps.

    https://learn.microsoft.com/en-us/sysinternals/downloads/procmon

    0 comments No comments

  3. Limitless Technology 39,351 Reputation points
    2021-10-06T14:29:37.437+00:00

    Hello,

    Thank you for your question and reaching out. My name is Prakash and I’d be more than happy to help you with your query.

    When Synchronize Across Time Zones is disabled, a trigger’s start date/time is relative to the computer’s time zone. For example, if a trigger’s start date/time is set to 10am on the 1st February 2020, the task will run once that date/time has been reached according to the computer’s time zone.

    Also for the task taking 3 hours to complete you need verify the logic of script or Task whether its file copying or scanning something etc.
    You can also put logging in your script so that you can have a look on which step its taking time.


    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments

  4. Psiax 21 Reputation points
    2021-10-09T13:43:18.117+00:00

    Thank you all for your responses.

    @Andreas Baumgarten wrote have you tried the option Synchronize across time zones

    @Limitless Technology wrote: When Synchronize Across Time Zones is disabled, a trigger’s start date/time is relative to the computer’s time zone. For example, if a trigger’s start date/time is set to 10am on the 1st February 2020, the task will run once that date/time has been reached according to the computer’s time zone.

    Two points:

    1. Since I first wrote I see the start times are not consistently 6 hours late. Sometimes they start 3 hours late, sometimes 9 hours late.
    2. There is no computer-to-computer communication involved. So I would think, based on what Limitless wrote, I can set the time of the job and it runs at that (local) time. In other words, common sense. That is my experience on the old computer. For years the jobs started on time, every time and "Synchronize Across..." was disabled.

    I have noticed "WakeToRun" is disabled for the new computer. Will try that first, then move on to "Synchronize Across...". Best to change one thing at a time....

    @MotoX80 wrote Without knowing what you have in C:\BackupTools\MirrorBackup.cmd I will have to refer to my Magic Crystal Ball, but sadly it has dead batteries at the moment.

    Sorry, didn't mean for anyone to get out their crystal ball :-)

    A reminder this is a personal home computer, not a server or corporate setting. There are 2 jobs to backup the files under \computer\user to an external (USB) disk. Each has only 1 command: Backup changes using XCOPY and full (mirror) backup using ROBOCOPY.

    I now realize I had excluded AppData for the old computer but included it with the new one. That could explain the longer time, as AppData has a ton of files, but I'm not convinced that explains it completely. Both XCOPY and ROBOCOPY are provide logs and I can use the suggestion to capture stdout/stderr and dig further.

    BOTTOM LINE:
    For the reason(s) the jobs take so long, I feel comfortable using the logs to dig further.
    For the start time, will change one setting at a time and report back on results.

    Thanks again.