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)# | .---- ...
随机推荐
- Laravel 解决在ajax 请求下不能保存session的问题
Laravel 解决在ajax 请求下不能保存session的问题 \Session::put('isLogin',true); // 你要保存的session key \Session::put(' ...
- PHP5中__get()、__set()方法
标题是:PHP5中__get().__set()方法,不错,在PHP5以下(PHP4)是没有这两个方法的. __get()方法:这个方法用来获取私有成员属性值的,有一个参数,参数传入你要获取的成员属性 ...
- 激活windows系统
1.下载KMS 2.如图所示,双击KMSpico看是否正常运行 3.双击KMSpico正常后出现以下界面 4.点击红色按钮 5.等自动退出就是激活成功,大概半年需要激活一次
- PAT 1014 Waiting in Line (模拟)
Suppose a bank has N windows open for service. There is a yellow line in front of the windows which ...
- 巧用命令行工具 redis-cli
我们天天都在使用 Redis 内置的命令行工具 redis-cli,久而久之以为它就是一个简单的交互式 Redis 数据结构手工操作程序,但是它背后强大的功能绝大多数同学可能闻所未闻.本节我们一起来挖 ...
- 如何使html中的元素不被选中
有时候,为了提高用户的体验度,需要使网页中的部分内容防误操作,不被选中,比如今天的商城项目中的一个细节部分: + —号其实是a标签做的,当连续点击多次,就会使符号被选中,这样感觉起来不太好,于是查找解 ...
- Bugku-CTF社工篇之简单的个人信息收集
- js屏幕上下滚动条
<!doctype html> <html> <head> <meta charset="utf-8"> <title> ...
- 比较器Comparable Comparator
一. Comparable Comparable 是排序接口,若一个类实现了 Comparable 接口,就意味着该类支持排序.实现了Comparable 接口的类的对象的列表或者数组可以通过 Col ...
- 小白学 Python 爬虫:Selenium 获取某大型电商网站商品信息
目标 先介绍下我们本篇文章的目标,如图: 本篇文章计划获取商品的一些基本信息,如名称.商店.价格.是否自营.图片路径等等. 准备 首先要确认自己本地已经安装好了 Selenium 包括 Chrome ...