Home arrow Journal arrow Run a command at a specified time
Run a command at a specified time PDF
Wednesday, 11 April 2012
If we want to run a command in FreeBSD at a specified time but we do not want to add it to cron service then we could use at command.

For example if we want to stop a machine at a specified date/hour we will run:

  echo "/sbin/halt -p"  |  at  17:39  11.04.2012

This will make use of at command that will queue /sbin/halt -p for execution at hour 17:39 on 11.04.2012.

To see all commandes added to run using at we will use atq:



  at -l

To delete a job from queue run:

  at -r 2

where 2 is job number.

Note: Using at is not very precise, at makes use of cron service and will run every 5 minutes to check if there are jobs added in queue for execution.

Last Updated ( Wednesday, 09 May 2012 )
< Prev   Next >

Other BSD Systems





Best BSD firewall?