Author: | Richard Isaacson |
---|
Use this module to schedule a command or script to run once in the future. All jobs are executed in the a queue.
parameter | required | default | choices | comments |
---|---|---|---|---|
action | yes | add |
|
The action to take for the job defaulting to add. Unique will verify that there is only one entry in the queue.Delete will remove all existing queued jobs. |
command | no | A command to be executed in the future. | ||
script_file | no | An existing script to be executed in the future. | ||
unit_count | yes | The count of units in the future to execute the command or script. | ||
unit_type | yes |
|
The type of units in the future to execute the command or script. | |
user | no | The user to execute the at command as. |
Note
Requires at
# Schedule a command to execute in 20 minutes as root.
- at: command="ls -d / > /dev/null" unit_count=20 unit_type="minutes"
# Schedule a script to execute in 1 hour as the neo user.
- at: script_file="/some/script.sh" user="neo" unit_count=1 unit_type="hours"
# Match a command to an existing job and delete the job.
- at: command="ls -d / > /dev/null" action="delete"
# Schedule a command to execute in 20 minutes making sure it is unique in the queue.
- at: command="ls -d / > /dev/null" action="unique" unit_count=20 unit_type="minutes"