[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
no way to compare when less than two revisions
Diferencias
Muestra las diferencias entre dos versiones de la página.
Próxima revisión | |||
— | es:howtos:software:at [2019/02/28 01:42 (UTC)] – creado slackwarespanol | ||
---|---|---|---|
Línea 1: | Línea 1: | ||
+ | <!-- Reviewed 2013-10-16 mfillpot --> | ||
+ | <!-- Add your text below. Start with a Headline (see button bar above). --> | ||
+ | ====== at - Task Scheduling ====== | ||
+ | **at** is a task scheduling tool which one-time enables tasks to be | ||
+ | performed on your system. The **batch** is | ||
+ | like **at** but permforms the one-time tasks when system load permits it, all | ||
+ | command and functions of **at** can be replicated by **batch** with the same | ||
+ | arguments. | ||
+ | |||
+ | ===== Related Commands ===== | ||
+ | The following commands are included to monitor the **at** command: | ||
+ | * **at** - The program used to submit a one-time task. | ||
+ | * **atq** - The program used to review the queue of jobs submitted with **at** | ||
+ | . | ||
+ | * **atrm** - The program used to remove jobs from the at queue. | ||
+ | |||
+ | ===== at Command Use ===== | ||
+ | The **at** command can be issued to allow you to write a custom script or | ||
+ | point it to a pre-built script. In addition, the broad time specifications | ||
+ | allowed increase the complexity. | ||
+ | |||
+ | The //-m// argument can be added to any command telling the daemon to mail | ||
+ | the user on the local system advising of the completion of the task. | ||
+ | |||
+ | ==== Scheduling an Existing Script ==== | ||
+ | This example will tell the **at** application to run the script | ||
+ | /// | ||
+ | completion. | ||
+ | < | ||
+ | user@darkstar$ at 16:00 -m -f / | ||
+ | </ | ||
+ | |||
+ | As you can see the //-f// argument means **file** as it points to the | ||
+ | file that will be executed. | ||
+ | |||
+ | ==== Scheduling a New Action ==== | ||
+ | As seen below, when no file is specified the **at** application opens a | ||
+ | prompt for the user to enter the new script. | ||
+ | |||
+ | < | ||
+ | user@darkstar$ at 19:40 -m | ||
+ | warning: commands will be executed using /bin/sh | ||
+ | at> ping -c 4 www.google.com | ||
+ | at> echo $? | ||
+ | at> <EOT> | ||
+ | job 4 at Sun Dec 30 19:40:00 2012 | ||
+ | </ | ||
+ | |||
+ | The user will need to type the sequence of commands that will be issued | ||
+ | within the prompt, upon completion you close the prompt with the | ||
+ | < | ||
+ | |||
+ | The command above instructed **at** to ping google 4 times at 7:40PM, return | ||
+ | the application status and e-mail the results to the user. | ||
+ | |||
+ | <note important> | ||
+ | Be sure to note the job number, it is the only visible identifier for the job | ||
+ | and must be referenced if you wish to remove the job later. | ||
+ | </ | ||
+ | |||
+ | ==== Reviewing Queued Tasks ==== | ||
+ | The command **atq** lists the user's pending jobs. The output is Job Number, | ||
+ | date, hour, queue and username. | ||
+ | < | ||
+ | user@darkstar$ atq | ||
+ | 4 Sun Dec 30 19:40:00 2012 a user | ||
+ | </ | ||
+ | |||
+ | Once the task number has been noted you can review the commands that are | ||
+ | included in the job by issuing the command //at -c {jobnumber}//, | ||
+ | |||
+ | < | ||
+ | user@darkstar$ at -c 4 | ||
+ | #!/bin/sh | ||
+ | # atrun uid=1000 gid=1000 | ||
+ | # mail user 1 | ||
+ | umask 22 | ||
+ | ....Environment Details.... | ||
+ | cd /home/user || { | ||
+ | echo ' | ||
+ | exit 1 | ||
+ | } | ||
+ | ping -c 4 www.google.com | ||
+ | echo $? | ||
+ | |||
+ | </ | ||
+ | |||
+ | ==== Removing Queued Tasks ==== | ||
+ | The command **atrm** removes jobs from the pending queue, it does not present | ||
+ | any confirmation that the job is removed so it may be advisable to run | ||
+ | **atq** after **atrm** to confirm the job has been removed. | ||
+ | < | ||
+ | user@darkstar$ atrm 4 | ||
+ | </ | ||
+ | |||
+ | ====== Further Resources ====== | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | |||
+ | |||
+ | ====== Sources ====== | ||
+ | |||
+ | <!-- If you copy information from another source, then specify that source --> | ||
+ | < | ||
+ | slackware-package-management|Linux.com]] --> | ||
+ | |||
+ | <!-- Authors are allowed to give credit to themselves! --> | ||
+ | * Originally written by [[wiki: | ||
+ | |||
+ | <!-- Please do not modify anything below, except adding new tags.--> | ||
+ | <!-- You must also remove the tag-word " | ||
+ | l not show up in the Table of Contents --> | ||
+ | {{tag> | ||