一、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介绍的更多相关文章

  1. linux任务计划 chkconfig工具 systemd管理服务 unit介绍 target介绍

    linux任务计划 任务计划:特定时间备份数据,重启服务,shell脚本,单独的命令等等. 任务计划配置文件:cat /etc/crontab [root@centos7 ~]# cat /etc/c ...

  2. 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介绍 ...

  3. Linux centosVMware 自动化运维Ansible介绍、Ansible安装、远程执行命令、拷贝文件或者目录、远程执行脚本、管理任务计划、安装rpm包/管理服务、 playbook的使用、 playbook中的循环、 playbook中的条件判断、 playbook中的handlers、playbook实战-nginx安装、管理配置文件

    一.Ansible介绍 不需要安装客户端,通过sshd去通信 基于模块工作,模块可以由任何语言开发 不仅支持命令行使用模块,也支持编写yaml格式的playbook,易于编写和阅读 安装十分简单,ce ...

  4. Android窗口管理服务WindowManagerService的简要介绍和学习计划

    在前一个系列文章中,我们从个体的角度来分析了Android应用程序窗口的实现框架.事实上,如果我们从整体的角度来看,Android应用程序窗口的 实现要更复杂,因为它们的类型和作用不同,且会相互影响. ...

  5. Linux centos7 Linux网络相关、firewalld和netfilter、netfilter5表5链介绍、iptables语法

    一. Linux网络相关 yum install net-tools ifconfig查看网卡ip ifup ens33开启网卡 ifdown ens33关闭网卡 设定虚拟网卡ens33:0 mii- ...

  6. Linux Centos7 环境搭建Docker部署Zookeeper分布式集群服务实战

    Zookeeper完全分布式集群服务 准备好3台服务器: [x]A-> centos-helios:192.168.19.1 [x]B-> centos-hestia:192.168.19 ...

  7. linux运维、架构之路-SSH远程管理服务

    一.SSH服务功能介绍 1.远程登录管理 提供类似telnet远程联机服务器的服务,即上面提到的SSH服务 2.远程传输文件 是类似FTP服务的sftp-server,借助SSH协议来传输数据的,提供 ...

  8. linux任务计划cron

    linux任务计划cron 1.crontab命令任务计划配置文件 [root@bogon ~]# cat /etc/crontab SHELL=/bin/bash PATH=/sbin:/bin:/ ...

  9. linux cron计划任务、chkconfig 命令、systemd命令、unit 相关、target 相关

    1.设置说明位置 : cat /etc/crontab # Example of job definition:# .---------------- minute (0 - 59)# | .---- ...

随机推荐

  1. VSCode的安装和使用

    VSCode的安装和使用 1.先到下载地址选择适合自己系统的VSCode安装软件 https://code.visualstudio.com/#alt-downloads 以上分别是Windows , ...

  2. Unknown failure (Failure - not installed for 0) 、Error while Installing APKs

    解决方法一: 设置 -> 更多设置 -> 开发者选项 ->关闭启用MIUI优化 解决方法二:(这种方法就用不了apply changes的功能了) 描述:在一些机型上安装软件 提示卸 ...

  3. Java将数据进行分组处理

    将传人的数据进行分组,使用map保存每组的数据. /** * 将取出的数据进行分组 * @param list * @return */ public Map<Integer,Object> ...

  4. 数制的运用-CodeForces - 535B

    题解: 因为每一位只可能是4或者7,可以类比二进制的思想. 基数为2,每一位的权值为2i-1:数字4表示的大小为1*2i-1:数字7表示的大小为2*2i-1. 将给定的n按照这种方法进行分解,求和.即 ...

  5. markdown区块

    Markdown 区块 Markdown 区块引用是在段落开头使用 > 符号 ,然后后面紧跟一个空格符号: > 区块引用 > 菜鸟教程 > 学的不仅是技术更是梦想 显示结果如下 ...

  6. IE浏览器清浮动

    .cfx:after,.cfx:before{content:" ";display:table;}.cfx:after{clear:both;}.cfx{*zoom:1;} 今天 ...

  7. ABC156D

    [题目链接]https://atcoder.jp/contests/abc156/tasks/abc156_d 简单数论问题,题意就是有n个数,不能组成a与b个数,问有多少种组合方式 那就是C(n,1 ...

  8. 【笔记5-购物车及地址模块】从0开始 独立完成企业级Java电商网站开发(服务端)

    购物车模块 数据库表设计 购物车表 CREATE TABLE mmall_ cart ( 'id' int(11) NOT NULL AUTO_ INCREMENT, 'user_ id' int(1 ...

  9. python两个_多个字典合并相加

    这只是符合比较正常的需求和场景. #一.适用合并两个字典(key不能相同否则会被覆盖),简单,好用. A = {'a': 11, 'b': 22} B = {'c': 48, 'd': 13} #up ...

  10. C# 集合类型学习

    如果你掌握了一门语言的数据结构 ,那么你离掌握这门语言 也不远了 1.列表 对于list,值得一提的是 Capacity 属性,使用默认的构造函数 ,让我们用代码来说明 var intList = n ...