Script reports all the scheduled jobs

Getting bogged down trying to find out if scheduled jobs are succeeding? This handy script helps log all of your scheduled tasks into one file.

If you are running many scheduled tasks on each server, it may be time consuming to log on to each server to check if a scheduled task has succeeded or failed. These scheduled tasks can be any of a number of operations:

 

  1. Ntbackup
  2. Veritas Backups
  3. Discleanup jobs
  4. Robocopy Jobs
  5. SQL backups

Whether a job is a success or failure, a log is generated in the application log or system log.

ELDump is a free tool that reads the contents of the log file. This tool can be effectively used with some scripting to report all the jobs to a particular place. This can make the network administrator's job much easier.

You can write a script (as shown below) for a Veritas Backup exec job and schedule it to run after the Veritas backup job is completed. You should know the timeframe of when the backup exec job will be completed. The same can be done for all the scheduled tasks with some minor changes in the script. This is an effective way of reporting the scheduled jobs in a common place.

Here is the script:

echo off

net use \ServerReportc$ /del
(ServerReport is the server where all the scheduled jobs would be reported.)

net use \ServerReportc$ /user:domainnameuseraccount password
(Logging onto the ServerReport server.)

cd
(Changing the path to the location where eldump is copied.)

eldump -l application -A 2 -m "backup exec" > c:BackupExec.log
(Checks all the backup exec logs in the last two hours and dumps it to backupexec.log file.)

FOR /F "tokens=13,14*" %%2 IN (c:backupexec.log)
DO if %%2==Job echo %computername% , %date%, %%2 %%3 %4>>\ ServerReportReport.txt
(Checks if the 13 character in a line is job. If it satisfies the condition then it reports in the reports.txt.)

Please let us know how useful you find this tip by rating it below! If you have a useful Windows tip, timesaver or workaround to share, submit it to our tip contest and you could win a prize!

This was first published in August 2006

Dig deeper on Microsoft Active Directory Backup and Restore

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchServerVirtualization

SearchCloudComputing

SearchExchange

SearchSQLServer

SearchWinIT

SearchEnterpriseDesktop

SearchVirtualDesktop

Close