Part 1: at Command 1. at Command: execute a specified task at a specified time, only once, and you need to enable the atd process (ps-ef | grepatd view, enable/etc/init. d/atdstartorrestart...
Part 1: at Command
1. at Command: to execute a specified task at a specified time, it can only be executed once. you must enable the atd process (ps-ef | grep atd view, and enable/etc/init. d/atd start or restart; run chkconfig -- level 2345 atd on when starting the system ).
[Root @ localhost test] at now + 1 min
At> echo "hello">/dev/tty2 and press enter # send "hello" to the tty2 terminal one minute later
-- Note: Use ctrl + d to terminate character input (that is )
At
At> echo "test at command">/home/test.txt
At
At>/sbin/shutdown-h now # use the absolute path here
The task created by the at command is placed under/var/spool/at. it is a script file and can be edited using vi.
At now + 1 min
At> echo "hello" # At this time, the email will be sent to the currently executed person. you can view the email by using the mail command, that is, use the mail command first, and enter '1' to view the message.
Atq command: Queries which tasks are waiting for execution on the current machine. The first column is the work number.
Atrm command: cancel the task. for example: atrm 10 #10 indicates the work number.
Batch commands: execute tasks with a low-priority latency.
Batch
At> echo "hello">/home/abc.txt
2. at command security control
/Etc/at. allow # List users who can use the at command. first find the at. allow file and then find the at. deny file.
/Etc/at. deny # List users that cannot use the at command, one row at a time.
If no at. allow file or at. deny file exists, only the root user can execute the at command.