There are two types of scheduled tasks in Linux system, one is the at scheduled task which will only be executed once, and the other is the cron scheduled task which can be executed periodically. at One-time scheduled tasks describe Execute a specific command (single time) at a specified time, also called a delayed action task. usage at time [Enter] parameter at -l #List single scheduled tasks at -r task id ##Delete the task with this id at -d task id ##Delete the task with this id at -m #Make the command without output generate email at -M #Make the command with output generate email at -c task id ##View the action of the task with this id at -f file ##Use the commands recorded in the file as the execution commands of the delayed task Examples First check the system time [root@test ~]# date Thu May 17 18:40:11 CST 2018 Specify a single scheduled task (delayed action) [root@test ~]# at 18:45 ##Plan executed at 18:45 on the same day (18:45 2018-05-17) at> date ##Scheduled task content at> shutdown -h now ##Scheduled task content at> <EOT> ##Command input ends, press Ctrl+D to exit job 10 at Thu May 17 18:45:00 2018 ##The system prompts that there is a scheduled task numbered 10 Cron periodic scheduled tasks To use cron to schedule tasks, you need to ensure that the crond service is enabled and starts automatically at boot. # systemctl start crond # systemctl enable crond describe Maintain a periodic cron job file for each user. usage crontab [ -u user ] [ -l|-r|-e ] Options
corn plan task format
If you need to specify a time period, you can use a hyphen (-) to indicate a continuous period of time, a comma (,) to indicate several discontinuous periods of time, an asterisk (*) to indicate all periods of time, and a division sign (/) to indicate intervals of time. Example [root@test ~]# crontab -e : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : Cron scheduled task permissions To prevent users from arbitrarily defining their own scheduled tasks, administrators can implement ACL access control. The control files for the at scheduled tasks are /etc/at.allow and /etc/at.deny. By default, at.llow does not exist. The control files for cron scheduled tasks are /etc/cron.allow and /etc/cron.deny. By default, cron.allow does not exist. The above article on how Linux users can customize at and cron scheduled task execution is all I have to share with you. I hope it can give you a reference, and I also hope that you will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Simple writing of MYSQL stored procedures and functions
>>: WeChat applet realizes taking photos and selecting pictures from albums
This article shares a sharing sidebar implemented...
Table of contents cache Cache location classifica...
Generally speaking, the mouse is displayed as an u...
<br />The Internet is constantly changing, a...
This also caused the inability to upload png files...
PSD to div css web page cutting example Step 1: F...
Table of contents 1 View the current database con...
There are two ways to disable form submission in ...
In this blog, we will discuss ten performance set...
Preface When I was writing a small project yester...
This article example shares the specific code of ...
This article shares with you a graphic tutorial o...
Table of contents 1. Switch between production en...
HTTP Header Explanation 1. Accept: Tells the web s...