question

Psiax-3570 avatar image
0 Votes"
Psiax-3570 asked MotoX80 commented

Scheduled tasks start 6 hours late

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-generalwindows-10-setup
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MotoX80 avatar image
0 Votes"
MotoX80 answered MotoX80 commented

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.



capture.jpg (73.1 KiB)
capture4.jpg (42.1 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@MotoX80 - Thank you again for your time.

0 Votes 0 ·

You're welcome.

0 Votes 0 ·
AndreasBaumgarten avatar image
0 Votes"
AndreasBaumgarten answered

Hi @Psiax-3570 ,

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



image.png (25.9 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MotoX80 avatar image
0 Votes"
MotoX80 answered

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://docs.microsoft.com/en-us/sysinternals/downloads/procmon

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered

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--

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Psiax-3570 avatar image
0 Votes"
Psiax-3570 answered MotoX80 commented

Thank you all for your responses.

@AndreasBaumgarten wrote have you tried the option Synchronize across time zones

@LimitlessTechnology-2700 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.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

It's not as good as a crystal ball, or the Vulcan Mind Meld, but you can use the Windows Resource Monitor to watch disk activity.


139138-capture.jpg



Or user perfmon to watch how fast your external disk is responding.


139151-capture1.jpg


0 Votes 0 ·
capture.jpg (127.2 KiB)
capture1.jpg (76.4 KiB)
Docs-4663 avatar image
0 Votes"
Docs-4663 answered Docs-4663 edited

Please post your feedback in the applicable section so that the problems can be addressed:


From your earlier post:
""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.""


https://docs.microsoft.com/en-us/answers/content/idea/post.html


Most viewers typically cannot figure out the tags without guidance

Enter this tag:
Q&A
or
qna-feedback

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Psiax-3570 avatar image
0 Votes"
Psiax-3570 answered

Recap


Two scheduled tasks to make backup copies of docs, pixs, etc. at night to external drive. Ran perfectly for years on old computer. Will not run as scheduled on new computer. Windows 10 Home version on both computers.

Tried so far


Enabled History
Each day there is an event, with level Warning, that says "Task Scheduler could not launch task "\BACKUP-Changes" as scheduled. Instance "{2a339c02-bbc9-4609-b59c-d53534d161c4}" is started now as required by the configuration option to start the task when available, if schedule is missed." This doesn't really say anything other than "Finally getting around to doing what you wanted hours ago".

Changed Conditions > Wake the computer from Disabled to Enabled
Did not help. Both jobs are set to start at 11:30pm and today I see they both ran just after I logged in around 9:30am (i.e., the next day). General > Run whether user is logged in or not is Enabled.

Next to try


Triggers > On a schedule > Synchronize across time zones from Disabled to Enabled

General > Run with highest privileges from Enabled to Disabled (to match the setting on the old computer where everything ran just fine)

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Psiax-3570 avatar image
0 Votes"
Psiax-3570 answered Psiax-3570 edited

This change

Triggers > On a schedule > Synchronize across time zones from Disabled to Enabled

did not help. Jobs again started when I logged in this morning.

The more I think about it, the more I am concerned...jobs scheduled by apps (Microsoft, Adobe, security, updates, etc.) may not run as scheduled.

Can anyone recommend how to get help with this? It seems there are many MS forums...am I in the wrong one?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MotoX80 avatar image
0 Votes"
MotoX80 answered

Does the task need to run as your account? Can you use SYSTEM?

I don't know if this will help or not, but I wrote a Powershell script to monitor the next run time of a task. That would require leaving an account logged on to monitor your backup task. Or define another task to monitor your backup task. You would have to modify the script to write to a file instead of just console output.

One thing that it will do is to keep an eye on the time of day clock. If your pc is going to sleep, it will detect a big change in the clock and report that.

https://social.technet.microsoft.com/Forums/en-US/c0be6139-5198-46b2-9135-4e6dae49adaa/scheduled-task-firing-on-the-wrong-day-consistently?forum=winserver8gen


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Psiax-3570 avatar image
0 Votes"
Psiax-3570 answered

@MotoX80
I appreciate your suggestions, but a bit too technical for a "home user". I have enough tech background to have setup this task on my old computer and it ran successfully for years. And both old and new computers went to sleep every night, i.e., typical (I assume) for home computers.

So I was hoping this was something obvious to find / easy to fix, e.g., "change setting X to off". Writing scripts, using other accounts (thought I only had one account), etc. is a bit much for a mere mortal.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.