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

Introduction to Linux system swap space

Swap space is a common aspect of computing today,...

In-depth understanding of JavaScript event execution mechanism

Table of contents Preface The principle of browse...

Vue implements the function of calling the mobile phone camera and album

This article shares the specific code of Vue to a...

How to cancel the background color of the a tag when it is clicked in H5

1. Cancel the blue color of the a tag when it is ...

How to use libudev in Linux to get USB device VID and PID

In this article, we will use the libudev library ...

MySQL and MySQL Workbench Installation Tutorial under Ubuntu

Ubuntu install jdk: [link] Install Eclipse on Ubu...

How to implement page jump in Vue project

Table of contents 1. Create a vue-cli default pro...

Examples of importing and exporting MySQL table data

This article describes the import and export oper...

MySQL Installer 8.0.21 installation tutorial with pictures and text

1. Reason I just needed to reinstall MySQL on a n...

canvas.toDataURL image/png error handling method recommendation

Problem background: There is a requirement to tak...

js to implement a simple bullet screen system

This article shares the specific code of native j...

Tutorial on installing MySQL8 compressed package version on Win10

1 Download MySQL8 from the official website and i...

A brief analysis of controlled and uncontrolled components in React

Table of contents Uncontrolled components Control...