msgbartop
Adam Palmer MBCS CITP, Linux, PHP Programmer, MySQL Developer, Embedded Hardware, Security Consultant
Did my blog help you? Please link to me!
  dns test
 
RSS Feed
msgbarbottom

13 Apr 09 at, batch scheduling

‘batch’ is a very useful tool for scheduling jobs to run when the server is sufficiently idle to process them.

The default is to run jobs when the server load is less than 1.5 however this can be overwritten via the atd tool with -l.

batch takes input via STDIN, i.e.:

mysqldump -u backup –all-databases |batch

‘at’ executes a command at a specific time, ‘atq’ lists the current jobs, ‘atrm’ deletes a job by ID, and ‘batch’ executes jobs when server load drops below the defined level.

The timing of batch is obviously not predictable. If predictable scheduling is required, use ‘at’ for one shots or ‘cron’ for all others. The purpose of batch is to run non time sensitive tasks when the server is sufficiently idle. Examples include mailings, bulk updates such as ‘updatedb’ or ‘apt-get update’, and log rotating or log analyzing such as awstats.

Tags: , , , , , ,