Python 官方文档:入门教程 => 点击学习
任务计划/etc/crontab 任务计划配置文件crontab -e 编辑任务计划crontab -l(小写的L) 列出任务计划crontab -r 删除crontab -u [username] 指定某个用户1-5 表示范围1到51
任务计划
/etc/crontab 任务计划配置文件
crontab -e 编辑任务计划
crontab -l(小写的L) 列出任务计划
crontab -r 删除
crontab -u [username] 指定某个用户
1-5 表示范围1到5
1,2,3 表示或者
*/2 表示能被2整除的
要保证服务的启动状态 systemctl start crond.servive
/var/spool/cron/[username] 用户的cron计划内容
系统管理chkconfig
--level 34 network off/on 控制network的等级3和4开关
--add [servicename] 增加一行服务,前提是在/etc/init.d/目录下有文件
--del [servicename] 删除一行服务
系统管理systemd
systemctl list-units --all --type=service 列service清单
systemctl enable [servicename] 让服务开机启动
systemctl disable [servicename] 不让开机启动
systemctl status [servicename] 查看服务状态
systemctl stop [servicename] 停止服务
systemctl start [servicename] 启动服务
systemctl restart [servicename] 重启服务
systemctl is-enabled [servicename] 检查服务是否开机启动
/usr/lib/systemd/system/ 系统所有unit,分为以下类型
service 系统服务
target 多个unit组成的组
device 硬件设备
mount 文件系统挂载点
automount 自动挂载点
path 文件或路径
scope 不是由systemd启动的外部进程
slice 进程组
snapshot systemd快照
Socket 进程间通信套接字
swap swap文件
timer 定时器
systemctl list-units 列出所有正在运行的unit
systemctl list-units --all 列出所有
systemctl list-units --all --state=inactive 列出不在运行的unit
systemctl list-units --type=service 列出在运行的service
systemctl is-active [servicename] 查看某个服务是否为active
target
系统为了方便管理,用target来管理unit
systemctl list-unit-files --type=target
systemctl list-dependencies multi-user.target 查看这个target下有什么unit
systemctl get-default 获取默认target
systemctl set-default multi-user.target 设置默认target
一个service属于一种类型的unit
多个unit组成了一个target
一个target里面包含了多个service
--结束END--
本文标题: 24. 日常运维 3
本文链接: https://www.lsjlt.com/news/183947.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0