Windows 2008 – Running a Scheduled Task after another

I had a problem with my Windows 2008 SQL Server.

I have a scheduled task to handle the backups of the backups with robocopy and a very small disk.

I thought i could just delete the files after copying them to a network drive, but this is a lot harder than it look.

It looks like Windows Task Scheduler does not permit to run a task after another one has finished despite  the existence of an event log showing the task starting, running and completing.

However it is possible to define Custom Event, though the standard filter does not allow much control over the selection of the events.

So i found this XML to place in the Custom Event

1 2 3 4

Now insert this XML in the text box and where you read copy backup replace with the name of your previous task:

<QueryList> 
   <Query Id="0" Path="Microsoft-Windows-TaskScheduler/Operational"> 
      <Select Path="Microsoft-Windows-TaskScheduler/Operational">*[EventData [@Name='TaskSuccessEvent'][Data[@Name='TaskName']='\copy backup']]</Select> 
   </Query> 
</QueryList>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s