Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed explanation of scheduled tasks and delayed tasks under Linux

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

At

At + time

At 17:23 at > touch / mnt/file {1.. 9} # # delay Action at > Type ctrl+d # # to initiate the action at-l | atq # # View the current task at-d | atrm # # cancel the specified task at-c # # View the task content at now+1min # # delay one minute at-f file # # delay the contents of the execution file at-m # # send email to execution when the delayed command is not output The at-M # # delay command has output but does not send an email to the executor

The setting of executive power of at order

/ etc/at.deny # # user blacklist. Users appearing in this list cannot execute the at command / etc/at.allow # # user whitelist. The list does not exist by default, but once the list appears, all users of the blacklist system cannot execute at by default. Only users who appear in the list can use the at command.

Crontab

Initiating method one

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

Initiating method 2

Vim / etc/cron.d/filename # # Edit the contents of this file for a minute, hour, day, month, week user action * root rm-fr / mnt/* # superuser cleans up / mnt every minute

The setting of executive power of crontab order

/ etc/cron.deny # # user blacklist. Users appearing in this list cannot execute the crontab command / etc/cron.allow # # user whitelist. The list does not exist by default, but once the list appears, the blacklist becomes invalid. All users of the system cannot execute crontab by default, and only those users who appear on the list can use the

The service in the temporary file system generates temporary files during normal operation.

Vim / usr/lib/tmpfiles.d/*.conf # # configuration file type file name file permissions file owner file all group 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 up temporary files

The above is the detailed explanation and integration of scheduled tasks and delayed tasks under Linux introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support to the website!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report