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计划内容
--level 34 network off/on 控制network的等级3和4开关 --add [servicename] 增加一行服务,前提是在/etc/init.d/目录下有文件 --del [servicename] 删除一行服务
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