Solved

Task Scheduler Windows 2008 R2

Posted on 2013-05-10
3
1,071 Views
Last Modified: 2013-05-20
My task scheduler is not doing what the history file for the task says it is doing.  All I'm doing is copying a MySQL DB from a production server to a backup server.  I'm launching a bat script which then launches a PS script.  The PS script looks for the newest file in the production backup directory and copies it to the backup directory on the backup server.

The PS script works by itself.  The bat script successfully launches the PS script.  I can manually launch the task from CLI and from within the Task Scheduler and the backup occurs.  The trigger is to run daily at 9 PM, and it is enabled.  The task is set to run whether I'm logged on or not, and I've set it to run on a domain admin account.

The history tab in task properties shows that that job is successfully run every day, yet unless I manually launch the job, the copy doesn't occur.

The task runs from the production server, which is a fairly busy server as it hosts our CRM application.

The only strange thing that I notice is that when I open TS and click on the TS library, the info pane  shows that the trigger is set for 9PM every day, yet "Next Run Time" is for 10PM today, and that "Last Run Time" was 10PM last night (which didn't occur).

The "Last Run Result" for the task is "The operation completed successfully. (0x0)"

The servers are in 2 different Sites and are connected by a fast WAN link, but it's obviously not a connectivity issue or I should be seeing errors in the History tab.
0
Comment
Question by:sgt_zim
  • 2
3 Comments
 
LVL 15

Expert Comment

by:ZabagaR
ID: 39156863
Can you put a line of code in the .bat script and the PS script that echo a line of text to a temp file? At least you can check the temp file afterward to see how far the script(s) got.
Make sure the other tabs on 'task scheduler" aren't stopping it. For instance, uncheck the "don't run while on battery power" box. I had servers that for some reason thought they were on battery, and never launched their task. That's under the 'conditions' tab. I'm assuming your user has the user privilege to 'logon as a batch job'...an admin should have.
Is there any reason your script may require an interactive user session? some code won't run unless a user has an active windows session. That's all I can think of right now.
0
 

Author Comment

by:sgt_zim
ID: 39182178
Zabag, I tried all of that.  Digging around a bit more, I discovered that the problem was the DST offset.  Turned the DST offset off and the scripts do their job.
0
 
LVL 15

Accepted Solution

by:
ZabagaR earned 500 total points
ID: 39182581
Oh okay. Doesn't DST automatically know when to adjust the time? I'm surprised it needed manual intervention. Well you got it working, that's all that matters.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Encryption of server 7 68
finding who created AD 4 45
Expand C partition 13 21
Can't install Citrix Receiver anymore 10 26
If you migrate a Terminal Server licenses server inside the 2008 server family, you can takte advantage of the build-in migration tool. If you like to migrate an older 2003 Server (and the installed client CALs) to a 2008 R2 server for example, you …
I had a question today where the user wanted to know how to delete an SSL Certificate, so I thought that I would quickly add this How to! Article for your reference. WHY WOULD YOU WANT TO DELETE A CERTIFICATE? 1. If an incorrect certificate was …
This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now