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

MySQL 5.6.24 (binary) automatic installation script under Linux

This article shares the mysql5.6.24 automatic ins...

8 JS reduce usage examples and reduce operation methods

reduce method is an array iteration method. Unlik...

Docker custom network implementation

Table of contents 1. Customize the network to rea...

Determine whether MySQL update will lock the table through examples

Two cases: 1. With index 2. Without index Prerequ...

How to disable web page styles using Firefox's web developer

Prerequisite: The web developer plugin has been in...

Web Design Tutorial (8): Web Page Hierarchy and Space Design

<br />Previous article: Web Design Tutorial ...

Vue realizes the logistics timeline effect

This article example shares the specific code of ...

Installing Windows Server 2008 operating system on a virtual machine

This article introduces the installation of Windo...

Implementation example of Nginx+Tomcat load balancing cluster

Table of contents introduction 1. Case Overview 2...

An article to understand the execution process of MySQL query statements

Preface We need to retrieve certain data that mee...

JavaScript to achieve mouse drag effect

This article shares the specific code of JavaScri...

How to use type enhancement without typingscript

Preface Due to the weak typing of JS, loose writi...

Detailed explanation of the difference between uniapp and vue

Table of contents 1. Simple page example 2.uni-ap...