计划任务
service crond start //启动服务
service crond stop //关闭服务
service crond restart //重启服务
service crond reload //重新载入配置
service crond status //查看crontab服务状态
//计划任务2
sh文件开头部分加
#!/bin/sh
source /etc/profile
48 16 * * * cd /home/test/home && ./restart.sh
每一小时 (0 */1 * * * )
每2小时 (0 */2 * * * )
echo $(date) ‘_start_success,’ >>restart_log.txt 2>&1
本文介绍如何使用CRON服务进行计划任务的配置,并通过具体的Shell脚本示例展示不同频率执行任务的方法。文章详细解释了启动、停止、重启及重新载入CRON服务的操作指令,同时给出了一个实际的Shell脚本案例,用于每小时执行特定任务。
4059

被折叠的 条评论
为什么被折叠?



