Linux centos7 linux任务计划cron、chkconfig工具、systemd管理服务、unit介绍、 target介绍
一、linux任务计划cron
crontab -u -e -l -r
格式;分 时 日 月 周 user command
文件/var/spool/corn/username
分范围0-59,时范围0-23,日范围0-31,月范围0-12,周1-6


可用格式1-5表示一个范围1到5
可用格式1,2,3表示1或2或3
可用格式*/2表示被2整除的数字,比如小时,那就是每隔2小时
启动

systemctl etop crond停止

systemctl start crond.service
二、chkconfig工具
chkconfig --list

chkconfig --level 3 network off

chkconfig --level 345 network off

chkconfig --del network

chkconfig --add network

三、systemd管理服务,是linux下的一种init软
systemctl list-units --all --type=service

几个常用服务相关指令
systemctl enable crond.service 让服务机开机启动
systemctl disable crond 不让开机启动
systemctl status crond 查看状态
systemctl stop crond 停止服务
systemctl restart crond重启服务
systemctl is-enabled crond检查服务是否开机启动

三、unit介绍
ls /usr/lib/systemd/system 系统所有unit

service系统服务
target多个unit组成的组
device硬件设备
mount文件系统挂载点
automount自动挂载点
path文件或路径
scop不是由systemd启动的外部进程
slice进程组
snapshot systemd快照
socket进程间通信套接字
swap 文件
timer定时器
unit 相关指令
systemctl list-units 列出正在运行的unit

systemctl list-units --all列出所有,包括失败的或者inactive

systemctl list-units --all --state=inactive 列出inactive的service

systemctl list-units --type=service 列出状态为active的service

systemctl is-active crond.service 查看谋个服务是否为active

四、target介绍
系统未来方便用target来管理unit
systemctl list-unit-files --type=target 指定target

systemctl list-dependencies mulit-user.target 查看指定target下有哪些unit

systemctl get-default 查看系统默认的target

systemctl set-default multi-user.target



一个service属于一种类型的unit
多个uniy组成了一个target
一个target里面包含多个service
cat /usr/lib/systemd/system/sshd.service 查看[install]部分

Linux centos7 linux任务计划cron、chkconfig工具、systemd管理服务、unit介绍、 target介绍的更多相关文章
- linux任务计划 chkconfig工具 systemd管理服务 unit介绍 target介绍
linux任务计划 任务计划:特定时间备份数据,重启服务,shell脚本,单独的命令等等. 任务计划配置文件:cat /etc/crontab [root@centos7 ~]# cat /etc/c ...
- linux任务计划cron、chkconfig工具、systemd管理服务、unit和target介绍
第8周第1次课(5月14日) 课程内容: 10.23 linux任务计划cron10.24 chkconfig工具10.25 systemd管理服务10.26 unit介绍10.27 target介绍 ...
- Linux centosVMware 自动化运维Ansible介绍、Ansible安装、远程执行命令、拷贝文件或者目录、远程执行脚本、管理任务计划、安装rpm包/管理服务、 playbook的使用、 playbook中的循环、 playbook中的条件判断、 playbook中的handlers、playbook实战-nginx安装、管理配置文件
一.Ansible介绍 不需要安装客户端,通过sshd去通信 基于模块工作,模块可以由任何语言开发 不仅支持命令行使用模块,也支持编写yaml格式的playbook,易于编写和阅读 安装十分简单,ce ...
- Android窗口管理服务WindowManagerService的简要介绍和学习计划
在前一个系列文章中,我们从个体的角度来分析了Android应用程序窗口的实现框架.事实上,如果我们从整体的角度来看,Android应用程序窗口的 实现要更复杂,因为它们的类型和作用不同,且会相互影响. ...
- Linux centos7 Linux网络相关、firewalld和netfilter、netfilter5表5链介绍、iptables语法
一. Linux网络相关 yum install net-tools ifconfig查看网卡ip ifup ens33开启网卡 ifdown ens33关闭网卡 设定虚拟网卡ens33:0 mii- ...
- Linux Centos7 环境搭建Docker部署Zookeeper分布式集群服务实战
Zookeeper完全分布式集群服务 准备好3台服务器: [x]A-> centos-helios:192.168.19.1 [x]B-> centos-hestia:192.168.19 ...
- linux运维、架构之路-SSH远程管理服务
一.SSH服务功能介绍 1.远程登录管理 提供类似telnet远程联机服务器的服务,即上面提到的SSH服务 2.远程传输文件 是类似FTP服务的sftp-server,借助SSH协议来传输数据的,提供 ...
- linux任务计划cron
linux任务计划cron 1.crontab命令任务计划配置文件 [root@bogon ~]# cat /etc/crontab SHELL=/bin/bash PATH=/sbin:/bin:/ ...
- linux cron计划任务、chkconfig 命令、systemd命令、unit 相关、target 相关
1.设置说明位置 : cat /etc/crontab # Example of job definition:# .---------------- minute (0 - 59)# | .---- ...
随机推荐
- python-用正则表达式筛选文本信息
[摘要] 本文主要介绍如何对多个文本进行读取,并采用正则表达式对其中的信息进行筛选,将筛选出来的信息存写到一个新文本. 打开文件:open(‘文件名’,‘打开方式’)>>>file ...
- 2019 EIS高校安全运维赛 misc webshell
webshell 第一种思路: 1.菜刀都是http协议,发的包都是POST包,所以在显示过滤器下命令:http.request.method==POST 2.右键,追踪tcp流,发现是蚁剑流量 3. ...
- 3、高级方法(Advanced Recipes)
学习目录:树莓派学习之路-GPIO Zero 官网地址:https://gpiozero.readthedocs.io/en/stable/recipes_advanced.html 环境:Ubunt ...
- Spring_第一个Spring入门案例IOC
今天我们来写我们的第一个spring 第一步 建立一个java project 第二步 添加我们的五个jar文件 第三步 在项目中建立一个com.zk.spring包 第四步 建立我们的userser ...
- ES-Result window is too large
问题: Result window is too large 解决: PUT http://127.0.0.1:9200/catalog/_settings { "index": ...
- C语言知识点记录
1,栈底指针不变,栈顶指针变化. 2,结构化程序包括:顺序,分支,循环. 3,详细设计的任务是为软件结构图的每一个模块确定实现算法和局部数据结构. 4,数据操纵语言:负责数据的操纵,包括查询及增,删, ...
- python csv 数据切割定制jmeter数据
需求压测随机抽取10w数据中自定义区间的指定数量数据进行压测: jmeter csv/txt配置: 需要获取{data: [${myList}] } jmeter需要数据类型 获取展读取csv数据 ...
- 《JavaScript高级程序设计》读书笔记(三)基本概念第六小节理解函数
内容---语法---数据类型---流程控制语句 上一小节---理解函数 本小节 函数--使用function关键字声明,后跟一组参数以及函数体 function functionName(arg0, ...
- 超长干货丨Kubernetes网络快速入门完全指南
Kubernetes网络一直是一个非常复杂的主题.本文将介绍Kubernetes实际如何创建网络以及如何为Kubernetes集群设置网络. 本文不包括如何设置Kubernetes集群.这篇文章中的所 ...
- cf 76 div2
传送门 题意 t组样例 n个学生, x最多交换次数 a交换的第一个位置 b交换的第二个位置 最多是交换n-1次,不懂的话可以找个数列自己模拟一下: 然后其他的就是abs(a-b)+x;两个位置之间的距 ...