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)# | .---- ...
随机推荐
- Plastic Bottle Manufacturer Profile: Plastic Bottle Forming Process
Plastic bottle molding refers to the process of making a final plastic product from a polymer produc ...
- CSS 动画过程及间接实现样式延时
/* 过度动画自动归位 */ @keyframes animation_button_scene { 0% { background: #9cacb4; } 10% { /* 样式过度2 */ } 6 ...
- java中对象的初始化问题
最近又把java编程思想看了看.又有些收获.此书确实不错 java中的初始化相信很多人都知道.但是具体的初始化步骤,初始化几次确不一定.上代码 public class A{ public stati ...
- Educational Codeforces Round 76 (Rated for Div. 2)E(最长上升子序列)
#define HAVE_STRUCT_TIMESPEC#include<bits/stdc++.h>using namespace std;int a[200007],b[200007] ...
- 提高Scrapy爬取效率
1.增加并发: 默认scrapy开启的并发线程为32个,可以适当进行增加.在settings配置文件中修改CONCURRENT_REQUESTS = 100值为100,并发设置成了为100. 2.降低 ...
- TakeColor下载及调节鼠标指针不一致的问题
取色器下载链接: 链接:https://pan.baidu.com/s/19TBWZA2ltaLQjzskTipnmg 提取码:2uz3 若出现指针与鼠标不一致: TakeColor v8.0 > ...
- 红黑树java代码实现
红黑树 思想源于:https://www.cnblogs.com/nananana/p/10434549.html有解释有图,很清晰(删除时需考虑根节点和兄弟节点的子节点是否存在) package t ...
- Spark Streaming实践和优化
发表于:<程序员>杂志2016年2月刊.链接:http://geek.csdn.net/news/detail/54500 作者:徐鑫,董西成 在流式计算领域,Spark Streamin ...
- Springboot学习:核心配置文件
核心配置文件介绍 SpringBoot使用一个全局配置文件,配置文件名是固定的 application.properties application.yml 配置文件的作用:修改SpringBoot自 ...
- 【安全运维】Vim的基本操作
i 插入模式 : 末行模式 a 光标后插入 A 切换行末 I 切换行首 o 换行 O 上一行 p 粘贴 u 撤销 yy 复制 4yy 复制四行 dd (剪切)删除一行 2dd (剪切)删除两行 D 剪 ...