Execute a command at any time you want with AT

What user of GNU / Linux he does not know what he is Cron? It is rare that someone has not heard or read about it Cron ever, but for those who do not know what it is for, because with the Cron we can execute a certain action in the month, day and hour that we want.

But it is not from Cron Who do I want to talk to you about in this post, if not AT, a command I discovered by reading the blog of humans and that allows us to execute an order at a specific time.

The difference between AT y Cron is that the first is not persistent, so if we restart the PC the task we entrust you will be lost. How does it work AT? Well, very simple, the basic way would be to write in the terminal:

$ at 15:37

And we should get something like this:
warning: commands will be executed using /bin/sh
at>

Later we write the command to execute at that time, for example:
at> killall console

Then we left AT typing Ctrl + D. In summary it will look something like this:

If you look at the image, when we finish AT gives us the number of the process we execute:

job 3 at Tue Oct  2 15:45:00 2012

In this case it is number 3. When we have several processes executed with AT, we can consult them with the command:

$ atq

When we know the process we want to kill, we just have to type:

$ atrm #

So, if I want to kill the example process, I just have to put:

$ atrm 3

Ready

AT has other options, such as the option to send us an email when it executes the task. These options can be seen by typing in the console:

$ man at


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   i axis said

    This I did not know and is very useful.
    In archlinux you have to install the at package and run the atd daemon to use it.

  2.   Nonamed said

    interesting, it can be useful at specific moments

  3.   crotus said

    I love terminal tips! Using Tilda / Yakuake for accessibility the terminal is a faithful ally.

  4.   hackloper775 said

    Very useful

    Thank you

  5.   asshole said

    on debian it requires "exim-base and exim-config"; There are a lot of people on debian who

  6.   BigM said

    Could you explain more or less what it does when you put "killall console" on it and how I know that my at has already been executed?

  7.   Alex said

    Bem objective! Bom artigo! Thank you!

  8.   pepo said

    Buff, it doesn't serve to permanently automate anything by attaching it to a command. The at command requires a human response to be executed.