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

系统环境:Kali GNU/Linux Rollingide

#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