Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Task Scheduler Windows 2008 R2

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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

877 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