systemctl cron
时间: 2023-08-26 15:17:40 浏览: 47
你好!关于你的问题,`systemctl cron`命令是无效的。`systemctl`是用于管理 Systemd 服务的命令,而`cron`是一个用于在预定时间自动执行任务的工具。如果你想启动或停止 cron 服务,可以使用以下命令:
启动 cron 服务:
```
sudo systemctl start cron
```
停止 cron 服务:
```
sudo systemctl stop cron
```
重启 cron 服务:
```
sudo systemctl restart cron
```
检查 cron 服务状态:
```
sudo systemctl status cron
```
希望这能解答你的问题!如果你有其他疑问,请随时提问。
相关问题
sudo systemctl restart cron.service Failed to restart cron.service: Unit not found.
如果在你的 Linux 系统中执行 `sudo systemctl restart cron.service` 命令时出现 `Failed to restart cron.service: Unit not found.` 的错误提示,可能是因为 crontab 服务并未安装或没有正确安装。
你可以先使用以下命令检查 crontab 是否已经安装:
```
which cron
```
如果 crontab 已经安装,该命令会返回 crontab 的安装路径,例如:`/usr/sbin/cron`。
如果 crontab 未安装,你可以使用以下命令安装:
```
sudo apt-get update
sudo apt-get install cron
```
安装完成后,再次执行 `sudo systemctl restart cron.service` 命令即可重启 crontab 服务。
如果仍然出现类似的错误提示,可以尝试使用以下命令检查 crontab 服务的状态:
```
sudo systemctl status cron.service
```
该命令会显示 crontab 服务的状态信息,你可以根据提示信息来进行修复。如果还有问题,可以在评论区留言。
Redirecting to /bin/systemctl start cron.service Failed to start cron.service: Unit cron.service not found.
这是一个系统服务启动失败的错误信息,提示cron服务没有找到。cron是一个用于在Linux系统上定期运行命令或脚本的守护进程。如果你想使用cron服务,你需要先安装它。你可以使用以下命令来安装cron服务:
```shell
sudo apt-get update
sudo apt-get install cron
```
安装完成后,你可以使用以下命令来启动cron服务:
```shell
sudo systemctl start cron
```
如果你想在系统启动时自动启动cron服务,你可以使用以下命令:
```shell
sudo systemctl enable cron
```