Detailed explanation of scheduled tasks and delayed tasks under Linux

Detailed explanation of scheduled tasks and delayed tasks under Linux

at

at + time

at 17:23 
at> touch /mnt/file{1..9} ##Delay action at> Type ctrl+d ##Initiate action at -l | atq ##View current task at -d | atrm ##Cancel specified task at -c ##View task content at now+1min ##Delay for one minute at -f file ##Delay execution of the contents in the file at -m ##Send email to the executor when the delay command has no output at -M ##Send email to the executor when the delay command has output 



Execution authority setting of at command

/etc/at.deny ##User blacklist. Users in this list cannot execute at commands. /etc/at.allow ##User whitelist. The list does not exist by default. But once the list appears, the blacklist becomes invalid. All users in the system cannot execute at by default. Only users in the list can use at commands.

crontab

Initiation method 1

crontab -u username -e ##Edit crontab work content crontab -u username -r ##Remove all crontab work content crontab -u username -l ##Query crontab work content 

Initiation method 2

vim /etc/cron.d/filename ##Edit this file content minute hour day month week user action * * * * * root rm -fr /mnt/* #Super user cleans up /mnt every minute 

Execution authority setting of crontab command

/etc/cron.deny ##User blacklist. Users who appear in this list cannot execute crontab commands. /etc/cron.allow ##User whitelist. The list does not exist by default, but once the list appears, the blacklist becomes invalid. By default, all system users cannot execute crontab. Only users who appear in the list can use it.

Temporary files are generated during normal operation of the service in the temporary file system

vim /usr/lib/tmpfiles.d/*.conf ##Configuration file type of temporary files in the system File name File permissions File owner File all groups File existence time d /mnt/westos 777 root root 10s 
 
systemd-tmpfiles –create /usr/lib/tmpfiles.d/* ##Execute temporary file configuration vim /usr/lib/tmpfiles.d/test.conf 
systemd-tmpfiles –clean /usr/lib/tmpfiles.d/* ##Clean temporary files 


The above is a detailed integration of scheduled tasks and delayed tasks under Linux introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • Linux crontab scheduled task configuration method (detailed explanation)
  • Linux uses crontab to implement PHP execution plan timing tasks
  • Detailed explanation of using python crontab to set up Linux scheduled tasks
  • Linux uses scheduled tasks to clean up logs 45 days ago every week
  • How to use crontab to execute a scheduled task once a second in Linux
  • Detailed explanation of Python script self-starting and scheduled tasks under Linux
  • Linux scheduled task access URL example
  • Detailed explanation of Linux scheduled tasks Crond
  • How to set up scheduled tasks in Linux
  • How to implement Mysql scheduled tasks under Linux

<<:  Comparing Node.js and Deno

>>:  MySQL storage engine basics

Recommend

Web designers should optimize web pages from three aspects

<br />With the increase of bandwidth, there ...

Detailed explanation of MySql 5.7.17 free installation configuration tutorial

1. Download the mysql-5.7.17-winx64.zip installat...

Specific use of useRef in React

I believe that people who have experience with Re...

MySQL trigger simple usage example

This article uses examples to illustrate the simp...

Solve the problem that Docker must use sudo operations

The steps are as follows 1. Create a docker group...

Comparison of the use of form element attributes readonly and disabled

1) Scope of application: readonly:input[type="...

5 ways to make your JavaScript codebase cleaner

Table of contents 1. Use default parameters inste...

Detailed explanation of the benefits of PNG in various network image formats

BMP is an image file format that is independent o...

How to retrieve password for mysql 8.0.22 on Mac

Mac latest version of MySQL 8.0.22 password recov...

How to achieve 3D dynamic text effect with three.js

Preface Hello everyone, this is the CSS wizard - ...

CSS injection knowledge summary

Modern browsers no longer allow JavaScript to be ...

Nginx Location directive URI matching rules detailed summary

1. Introduction The location instruction is the c...

Summary of how to modify the root password in MySQL 5.7 and MySQL 8.0

MySQL 5.7 version: Method 1: Use the SET PASSWORD...