A brief analysis of crontab task scheduling in Linux

A brief analysis of crontab task scheduling in Linux

1. Create a scheduling task

instruction

crontab -e enters the current user editing interface

crontab -u username-e Enter the specified user editing interface

Enter the crontab task editing interface

Task writing format

#Check the /ect directory once every minute and write the directory contents to /tml/a.txt

*/ 1 * * * * ll /etc >> /tmp/a.text

#crontab object + instructions

#Execute multiple tasks simultaneously
#crontab object command 1 & command 2

crontab object parameters

The first * indicates the minute range 0-59

The second * indicates the hour range: 0-23

The third * indicates the day. Range: 1-31

The fourth * indicates the month. Range: 1-12

The fifth * indicates the day of the week: 0-7 (0 and 7 both mean weekends)

The meaning of special symbols in crontab objects

* Any time

, represents multiple time points, such as 1,2 * * * * means that the command will be executed at 1:00 and 2:00 every day

- represents a closed interval between the time

*/N represents how often it is executed

2. View tasks

crontab -l View the tasks under the current user

crontab -u username -l View the tasks under the specified user

3. Delete tasks

crontab -r deletes tasks under the current user

crontab -u username -r deletes the tasks under the specified user

Summarize

The above is what I introduced to you about crontab task scheduling in Linux. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • Solution to Linux crontab timing execution of Shell scripts when specific commands need to be executed
  • How to implement second-level scheduled tasks with Linux Crontab Shell script
  • Regularly execute commands and scripts on Linux (cron, crontab, anacron)
  • How to use crontab to execute a scheduled task once a second in Linux
  • Detailed explanation of at and crontab commands for scheduled execution of tasks in Linux

<<:  Recommended plugins and usage examples for vue unit testing

>>:  Copy fields between different tables in MySQL

Recommend

Summary of common commands for building ZooKeeper3.4 middleware under centos7

1. Download and decompress 1. Introduction to Zoo...

How to create a Pod in Kubernetes

Table of contents How to create a Pod? kubectl to...

CSS and HTML and front-end technology layer diagram

The relationship between Javascript and DOM is ve...

Exploring the Linux Kernel: The Secrets of Kconfig

Get a deep understanding of how the Linux configu...

A bug fix for Tomcat's automatic shutdown

Preface Recently, a Java EE web project that has ...

Example of MySQL auto-increment ID exhaustion

Display Definition ID When the auto-increment ID ...

Axios cancel request and avoid duplicate requests

Table of contents origin status quo Cancel reques...

A brief analysis of Linux resolv.conf

1. Introduction resolv.conf is the configuration ...

How to install nginx in docker and configure access via https

1. Download the latest nginx docker image $ docke...

The pitfall record of case when judging NULL value in MySQL

Table of contents Preface Mysql case when syntax:...

How to convert a column of comma-separated values ​​into columns in MySQL

Preface Sometimes you come across business tables...

Detailed tutorial for installing mysql5.7.18 on centos7.3

1 Check the Linux distribution version [root@type...

Detailed explanation of how Zabbix monitors the master-slave status of MySQL

After setting up the MySQL master-slave, you ofte...