Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

At one-time task setting

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

At one-time task setting the scheduled task in the CentOS7 system is provided by the at,cronie software package, and the one-time and periodic scheduled task function is realized through the two system services of atd and crond, and the scheduled task is set by the at,crontab command to turn on the system service atd is the prerequisite for the scheduled task set by the at command. The schedule set by the at command is executed only once at a specified point in time. The premise is that the corresponding system service atd must pay attention to the time when the task is scheduled to be executed, and the date must be scheduled after the time of the current system. Otherwise, the basic format of the scheduled task at command cannot be set: at [HH:MM] [yyyy-mm-dd] is: at [hours: minutes] [year-month-day] the order in which the at command is used: view time-> set time-> enter command-> ctrl+D key submit task date: confirm the current time (before setting the task can no longer be current time) The ctrl+D key combination can be used to submit the task. When the time is up, you can use: cat to view the completion of the task.

Atq command: view tasks ready to be executed. For tasks that have been set up but have not been executed, you can view them through the atq command. (tasks that have been executed will not appear) the list of tasks viewed by atq, the sequence number of each task will not change. Even if the task with 1-5 serial numbers has been executed, the sixth unexecuted task displayed will have a serial number of 6 instead of becoming a 1atrm command: delete the specified number of at tasks atrm command is used to delete the specified number of at tasks, the number can be viewed through atq. Deleted at tasks will not appear in the atq display results. At is only an one-time task setting and will not be repeated. If you want to repeat a task, use the crontab command to set crontab is a periodic task setting (repeatable task)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report