?
Solved

Task Scheduler Windows 2008 R2

Posted on 2013-05-10
3
Medium Priority
?
1,094 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 2000 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

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For anyone that has accidentally used newSID with Server 2008 R2 (like I did) and hasn't been able to get the server running again because you were unlucky (as I was) and had no backups - I was able to get things working by doing a Registry Hive rec…
I’m willing to make a bet that your organization stores sensitive data in your Windows File Servers; files and folders that you really don’t want making it into the wrong hands.
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

599 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