系统延时任务及定时任务

1. 系统延时任务:

at相关命令

     at    time                            设定任务执行时间at> rm  -fr   /mnt/*                  任务动作at> <EOT>      <<ctrl+d               执行任务

在这里插入图片描述
at的命令:

                 -l             ##查看任务列表-c             ##查看任务内容-r             ##取消任务执行

在这里插入图片描述
在这里插入图片描述
注意:当有任务输出时,输出会以邮件的类型发送给at任务的发起者

> /var/spool/mail/root        ##清空邮件
mail -u root                  ##查看超级用户邮件
1                             ##查看第一封邮件
q                             ##退出at

在这里插入图片描述
在这里插入图片描述
at的黑白名单:

/etc/at.deny	##系统中默认存在,在此文件中出现的用户不能执行at
/etc/at.allow	##系统中默认不存在,当文件出现,普通用户不能执行at,只有在名单中的用户可以,并且/etc/at.deny失效

在这里插入图片描述
在这里插入图片描述
2. 系统定时任务
1.crontab 时间表示方式

   *       *       *       *       *                 /          ,        -分      时      天      月      周              每隔多久    几和几    从几到几* * * * *                                每分钟*/2  * * * *                             每两分钟*/2 09-17 * * *                          九点到十七点每两分钟*/2 */2 * * *                            每隔两小时每两分钟*/2  09-17  3,5  1  5                    1月的3号和5号,每周5,朝9晚5,每隔2分钟*/2 09-17 * * 5                          每周周五早9晚5每两分钟

2.系统控制crontab的服务
crond.service 当程序开启时定时任务生效
在这里插入图片描述
3.crontab相关命令

crontab -e -u  用户名  编写定时任务,文件保存在/var/spool/cron/用户名下,不加-u默认为命令行用户
crontab -l -u  用户名  查看指定用户定时任务
crontab  -r -u 用户名  取消指定用户定时任务

在这里插入图片描述
4.文件方式设定定时任务

         system status crond.service    查看crond服务是否开启vim /etc/cron.d/file           写入定时任务* * * * *	              srname                    action时间 	                      用户名 	                命令

在这里插入图片描述
在这里插入图片描述

5.crontab的黑白名单

/etc/cron.deny 系统中默认存在,在此文件中出现的用户不能执行crontab
在这里插入图片描述

/etc/cron.allow 系统中默认不存在的,当文件出现,普通用户不能执行crontab,只有在名单中的用户可以,并且/etc/at.deny失效
在这里插入图片描述
3. 系统中临时文件的管理方式

     1.cd  /usr/lib/tmpfiles.d/2.vim westos.conf写入d   /mnt/westos     777  root  root  8s     8s内不能被清3.systemd-tmpfiles  --create  /usr/lib/tmpfiles.d/westos.conf   让该文件生效4.systemd-tmpfiles  --clean   /usr/lib/tmpfiles.d/westos.conf   清除已超过保护时间的命令

在这里插入图片描述
在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/542177.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

cpn tools查看运行时间_Jmeter在Linux下的运行测试

一、JMeterApache JMeter是Apache组织开发的基于Java的压力测试工具。用于对软件做压力测试&#xff0c;它最初被设计用于Web应用测试&#xff0c;但后来扩展到其他测试领域。1.1、JMeter的作用能够对HTTP和FTP服务器进行压力和性能测试&#xff0c; 也可以对任何数据库进行同样…

css div滚动_如何使用CSS创建可垂直滚动的div?

css div滚动Introduction: 介绍&#xff1a; Dealing with divs has become a regularity and divs are used for many purposes like to structure our code and to segregate our various sections of codes. Besides, we are also aware of many properties that we can im…

Linux中磁盘分区的管理

1. 本地存储设备的识别 fdisk -l真实存在的设备cat /proc/partitions系统识别的设备blkid系统可使用的设备df系统正在挂载的设备 真实存在的设备不一定可识别&#xff0c;识别到的的设备不一定可使用 2. 设备的挂载和卸载 1&#xff09;设备名称 /dev/xdx …

python中时间的加减_python日期加减

python中关于时间和日期函数的常用计算总结 python中关于时间和日期函数有time和datatime 1.获取当前时间的两种方法: import datetime,time now = time.strftime("%Y-%m-%d %H:%M:%S") print now now = datetime.datetime.now()... 文章 技术小胖子 2017-11-08 848…

bst 删除节点_在BST中删除大于或等于k的节点

bst 删除节点Problem statement: 问题陈述&#xff1a; Given a BST and a value x, write a function to delete the nodes having values greater than or equal to x. The function will return the modified root. 给定一个BST和一个值x &#xff0c;编写一个函数删除值大…

游戏架构之二(转)

棋牌类游戏常用架构&#xff1a; 我从事过4年的棋牌类游戏开发&#xff0c;使用过的架构大致如上&#xff0c;各模块解释如下。 LoginServer&#xff1a; 登陆服务器&#xff0c;主要负责player 的登陆请求&#xff0c;验证player的合法性&#xff0c;为合法的player分配sessio…

对lvm介绍

1. 什么是LVM LVM是 Logical Volume Manager&#xff08;逻辑卷管理&#xff09;的简写&#xff0c;它是Linux环境下对磁盘分区进行管理的一种机制&#xff0c;用户在无需停机的情况下可以方便地调整各个分区大小。 lvm中的一些常见符号及意义 pv物理卷被lv命令处理过的物理分…

pythonweb自动化测试实例_[转载]python webdriver自动化测试实例

python webdriver自动化测试初步印象以下示例演示启动firefox&#xff0c;浏览google.com,搜索Cheese&#xff0c;等待搜索结果&#xff0c;然后打印出搜索结果页的标题from selenium import webdriverfrom selenium.common.exceptions import TimeoutExceptionfrom selenium.w…

repeated_Ruby中带有示例的Array.repeated_combination()方法

repeatedArray.repeated_combination()方法 (Array.repeated_combination() Method) In this article, we will study about Array.repeated_combination() method. You all must be thinking the method must be doing something which is related to creating combinations o…

ApacheHttpServer修改httpd.conf配置文件

转自&#xff1a;https://blog.csdn.net/dream1120757048/article/details/77427351 1. 安装完 Apache HTTP Server 之后&#xff0c;还需要修改一下配置文件。 Apache 的配置文件路径如下&#xff1a; C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf…

大学物理实验电学基本参数的测量实验报告_大学物理电学实验报告

技校网专门为您推荐的类似问题答案问题1&#xff1a;怎样写大学计算机基础有关制作个人简历的实验报告一、实验名称&#xff1a;个人简历的制作 二、实验目的与要求: 1、熟悉Word 2003的基本操作 2、掌握利用网络搜索获得个人简历所需的资料 3、培养同学们动手能力和自学能力。…

python 线程模块_Python线程模块| main_thread()方法与示例

python 线程模块Python threading.main_thread()方法 (Python threading.main_thread() Method) main_thread() is an inbuilt method of the threading module in Python. It is used to return the main Thread object. It is the thread from which the Python interpreter …

linux中系统修复

1. 引导文件丢失 &#xff08;1&#xff09;引导文件所在路径 /boot/grub2/grub.cfg 需提前知道根目录所在分区和内核版本 uname -r 查询内核版本命令 模拟问题 rm -fr /boot/grub2/grub.cfg 一不小心把这玩意儿给删了&#xff0c;还reboot了 完了以后机子开不了了就这情况 …

dw相对路径怎么改_密云ETL怎么收费

密云ETL怎么收费&#xff0c;派客动力&#xff0c;公司依托自有产品&#xff0c;整合行业资源&#xff0c;构建先进的数据管理解决方案&#xff0c;解决企业和组织的核心数据问题以及被影响的业务挑战。这种工具我都使用过&#xff0c;优点有&#xff1a;图形界面&#xff0c;开…

python 自动化之路 day 08_2 网络编程

本节内容 Socket介绍Socket参数介绍基本Socket实例Socket实现多连接处理通过Socket实现简单SSH通过Socket实现文件传送作业&#xff1a;开发一个支持多用户在线的FTP程序1. Socket介绍 概念 A network socket is an endpoint of a connection across a computer network. Today…

查看scala变量数据类型_Scala文字,变量和数据类型| Scala编程教程

查看scala变量数据类型1)Scala数据类型 (1) Scala Data Types) Scala has the same set of data types as in Java. The traditional 14 data types are inherited as it is in Scala. Scala具有与Java中相同的数据类型集。 传统的14种数据类型在Scala中被继承。 The Followin…

Elasticsearch过滤与聚合的先后顺序java实现

2019独角兽企业重金招聘Python工程师标准>>> 一、Elasticsearch的聚合 ES的聚合相当于关系型数据库里面的group by&#xff0c;例如查找在性别字段男女人数的多少并且按照人数的多少进行排序&#xff0c;在使用MySQL的时候&#xff0c;可以使用如下的句子 select se…

js手机号中间四位_11位手机号码隐藏中间四位数,学会Substitute函数一键搞定!...

相信许多朋友都有见过手机号码被*号隐藏中间四位数的情况。许多地方为了保护个人信息&#xff0c;都会将手机号的中间四位数用星号代替。如上图所示&#xff0c;我们需要将原来的手机号码&#xff0c;通过*号的方式变为隐藏后的加密模式。下面我们就来学习一下如何利用substitu…

python 整数最大_Python程序使用floor()方法查找最大整数

python 整数最大The greatest integer function is a function (real numbers function) to itself that is defined as follows: it sends any real number to the largest integer that is less than or equal to it. 最大整数函数是一个对其自身定义的函数(实数函数)&#x…

selinux对ftp的影响

1.啥是selinux 安全增强型Linux&#xff08;Security-Enhanced Linux&#xff09;简称selinux&#xff0c;它是一个Linux内核模块&#xff0c;也是Linux的一个安全子系统。 selinux的状态&#xff1a; Enforcing:强制模式&#xff0c;在selinux运作时&#xff0c;已经开始限制d…