utilizando o comando at linux
And alas! Let us understand more a Linux command, now the at . That also did not know until recently.
Imagine yourself in the following situation, you have to run a command now, so to come back from lunch (that’s damn silly example), but will only arrive at 14:30. and your boss wants the result of this command to 2 hours, or it will eat your … liver. Simple!! The command at will leave you with your … intact liver. Let’s practice, and stop bla bla.
The command behaves like a cron that will run, and then cease to exist. Much simpler than configuring a line in cron to run a command only once.
at practice
Assuming that the command that your boss wants to be shot tomorrow, and is the list of all users logged in at 14:00, by which it accesses a file on the network.
The command accepts multiple configuration variants of the date / time. For this example we use in this way
$ At 2pm tomorrow
at> who> / var / www / list_users.html
When you enter the command at it will open a “sub-terminal” at the for you to enter your command, in our case who> / var / www / list_users. html , to save at the command, use ctrl + d .
Tips command at linux
List commands (jobs) configured at the
Use command atq , it will list the work to be performed, for your user, if you are the root of all the users.
$ Atq
Delete commands (jobs) configured at the
Use command atrm , it will remove a specific job, you should specify the work to be removed. For example:
$ Atq
5 Fri May 17 13:30:00 2013 vinicius
6 Fri May 17 13:31:00 2013 vinicius
$ 5 atrm
Going deep in at
I advise to read the documentation at as there are many tips on the same
man at
For example:
Running a command in 3 days at 4 o’clock
at 4pm + 3 days
Running a command on a specific day (18.10.2013) at 4 o’clock in the morning
Observer this example, the date is in standard MMDDCCYY
at 4am 10,182,013
Recent Comments