Schedule DBA jobs on Windows with AT command

Links: http://www.dbatools.net/experience/windows-at-command.html

    There are lots of database running on Windows, and lot's of useful utilities developed for Windows. Sometime DBAs need to schedule a utility to run at specific time. For example, extract data to text file for data warehouse team every night, perform full database backup every weekend. On Linux we can use crontab to schedule the job, On Windows, we can use the "AT" command. Take a look at the basic syntax of this command.

AT time [options] command [arguments]

    Specify what time to run the job.

AT 1:00 ...
AT 1:00PM ...
AT 21:00 ...

    The most common used option is "/every" to specify the frequency of the DBA job.

AT 1:00 /every:S,Su "backdb.bat"
AT 1:00 /every:M,T,W,Th,F,S,Su "backarc.bat"
AT 1:00 /every:1,16 "dwdata.bat"

    If you want to remove a job, you can run "AT" command without command line option, it will tell you a job id, then use command "AT id /delete" to remove it.

« Previous | Main | Next »

Powered by
Movable Type 5.01