「Cron」- 安装及注意事项 @20210418

系统环境:Kali GNU/Linux Rolling

#1 安装服务

#!/bin/sh

# 安装Cron服务:
apt-get install cron

# 启动并开机自启动Cron服务:
systemctl enable cron
systemctl start cron

# 查看服务状态:
systemctl status cron

# 如果手动启动Cron服务可以执行:
cron &

# 推荐使用systemd的方式来启动cron服务。

#2 启动服务

#!/bin/sh

# 安装服务
apt-get install cron

# 启动并开机自启动服务
systemctl enable cron
systemctl start cron

# 如果手动启动Cron服务可以执行:
cron &

# 推荐使用systemd的方式来启动cron服务。

#3 查看服务状态

# 查看服务状态:
systemctl status cron

相关文章

「Cron」- 创建周期任务
「Cron」- 执行日志
「Cron」- 使用技巧
「Cron and Anacron」- 杂记
「crontab」- 周期任务的配置文件

posted @ 2021-04-18 21:05  研究林纳斯写的  阅读(130)  评论(0编辑  收藏  举报