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)# | .---- ...
随机推荐
- ASP.NET CSRF 解决【网摘】
http://stackoverflow.com/questions/29939566/preventing-cross-site-request-forgery-csrf-attacks-in-as ...
- oracle中以dba_、user_、v$_、all_、session_、index_开头
原 oracle中以dba_.user_.v$_.all_.session_.index_开头 2011年07月05日 11:26:06 clbxp 阅读数:3279 oracle中以dba_.u ...
- 台电X16pro刷机记录
Android: 如果要刷安卓,需要使用win7系统电脑,且需要安装java环境,同时按住 音量减+电源键进入刷机模式(DNX BOOT MODE..),这时在PhoneFlashTool_5.3.2 ...
- go.php
<?php $t_url=$_GET['url']; if(!empty($t_url)) { preg_match('/(http|https):\/\//',$t_url,$matches) ...
- CSS-自适应网页使用@media和rem
@media 查询 @media 媒体查询选择性加载css,意思是自动探测屏幕宽度,然后加载相应的CSS文件.可以针对不同的屏幕尺寸设置不同的样式,特别是需要设置设计响应式的页面,@media 是个不 ...
- stl_list复习
#include <iostream>#include <list>#include <algorithm>using namespace std; //底层结构是 ...
- Springboot学习:Thymeleaf 语法基础
详细内容见:Thymeleaf Tutorial 中文翻译,中文文档 参考: thymeleaf官方指南 新一代Java模板引擎Thymeleaf Thymeleaf基本知识 thymeleaf总结文 ...
- 常用es5和es6语法区别,以及三个点的用法
链接:https://www.jianshu.com/p/b4d48e9846e7 //三个点 链接:https://blog.csdn.net/qiladuo1207/article/details ...
- GO第归
Go 语言递归函数 递归,就是在运行的过程中调用自己. 语法格式如下: func recursion() { recursion() /* 函数调用自身 */ } func main() { ...
- dom4j递归解析XML字符串所有子节点
/** * dom4j递归解析所有子节点 * * @param childElements * @param mapEle * @return */ public Map<String, Obj ...