[Linux] Linux practical operation --- scheduled task scheduling


1. Basic overview

Insert picture description here


2. Schematic diagram of principle

Insert picture description here


Three, basic grammar

Insert picture description here



Four, parameter details

Insert picture description here
Insert picture description here
Insert picture description here


Five, application cases

Case 1: Every 1 minute, append the current date information to the /tmp/mydate file

① Write a file first, /home/mytask1.sh

Insert picture description here


② Give mytask1.sh an executable permission

Insert picture description here


③ Edit crontab timing tasks

Edit crontab task
Insert picture description here
view task

*/1 * * * *   表示每隔一分钟执行一次

执行内容为:/home/mytask1.sh 中的内容

Insert picture description here


④ Successfully executed

Insert picture description here


Case 2: Every 1 minute, append the current date and calendar to the /home/mycal file

① Write a file first, /home/mytask2.sh

Insert picture description here


② Give mytask2.sh an executable permission

Insert picture description here


③ Edit crontab timing tasks
*/1 * * * *    代表每隔一分钟执行一次

执行内容为:/home/mytask.sh 中的内容

Insert picture description here


④ Successfully executed

Insert picture description here


Guess you like

Origin blog.csdn.net/weixin_45260385/article/details/114456652