logIt Log Around The Clock

Queue Job To Be Executed At Certain Times

A series of command can be queued by using at command. There are slight variations between UNIXs for at command, the following example is for Ubuntu.

Due to to the purpose of running it for OpenView managed nodes (this is some sort of trial-test), I put the job queue as if it was done through ovdeploy (remotely).

$ echo "cat /etc/hosts > tst.txt" >> tst.at.queue

the queued job is a simple cat directed to an output file (tst.txt).

This next at will queue whatever contained in tst.at.queue

$ at -f tst.at.queue now + 2 minutes
warning: commands will be executed using /bin/sh
job 6 at Mon Mar 30 22:40:00 2009

We can check at queues as:

$ atq
6       Mon Mar 30 22:40:00 2009 a arif

It says that the job will be run at a certain time which is at 22:40:00 system time. When the job is done, queue will become empty and tst.txt will be generated as described in job file tst.at.queue.


Leave a Reply