none
Scheduled Tasks Running 3 Hours Behind Schedule

    General discussion

  • I run a tool via the task scheduler that appears to be running 3 hours after it is scheduled to and I can't figure out why.

    The task is created via a command line script immediately before a server is rebooted.  The script schedules a profile cleanup tool to run 15 minutes after the server is rebooted.

    The task is setup properly and it runs as it should but it does not run on time.  Example:

    Server A was rebooted today at 7:14AM.  The profile cleanup tool is scheduled to run at 7:29AM.  At 8:05AM I found the task was still scheduled to run at 7:29AM.  At 10:29AM it will run but I don't know why.

    Our local time is Eastern Daylight Time.  The task is created as such:

    Schtasks /create /ru "System" /s localhost /tn "Profile Cleanup Task_%SCTaskTime%" /tr C:\Temp\ProfileCleanup\DeleteProfiles_Auto.bat /sc once /st %TaskTime% /F /V1 /Z >NUL

    %SCTaskTime% and %TaskTime% represent the time 15 minutes from when the script is run.  I didn't include the commands that manipulate time but today these were the values:

    %SCTaskTime%=0729

    %TaskTime%=07:29

    I've reviewed the log files created by the tool that the task runs and and they are time stamped properly (within the log, times are usually between 7:30AM and 8:30AM).  BUT!!!  The Date Modified in Windows shows that the log was created 3 hours after the profile cleanup tool was scheduled to run.  Furthermore the log shows results that align with the task having been run between 10:30AM and 11:30AM instead of between 7:30AM and 8:30AM.

    The final wrinkle here is that this task is created daily on dozens of servers and the behavior is the same on all of them.  This makes me think there is a problem with the task but I can't see it.  

    On all servers Synchronize Time Zones is unchecked.  When it is checked the task never runs because it appears to want to run 3 hours earlier then its scheduled time.

    Also note that if I create the task manually on the servers it runs at its properly scheduled time.

    I'm out of ideas for troubleshooting. All help is appreciated.

    Thanks,

    MJ

    Tuesday, April 29, 2014 12:46 PM

All replies

  • Hi MJ,

    Do you mean if the task scheduler was built with the console, it will run normally, however, it won't if the task was created with the cmd Schtasks /create?

    If so, would you please post the settings of the scheduled task configured correctly with console?

    Best Regards,

    Anna

    Thursday, May 01, 2014 3:15 AM
    Moderator