linux 定时执行shell

Posted 温故而知新`

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux 定时执行shell相关的知识,希望对你有一定的参考价值。

第一步:安装 crontab ,命令 yum -y install vixie-cron
扩展:service crond start //启动服务
service crond stop //关闭服务
service crond restart //重启服务
service crond reload //重新载入配置
service crond status //查看crontab服务状态
第二步:编写shell文件
要点:1、文件后缀随意它只是存放命令的文件
2、文件中的第一行一定是 #!bin/bash 这行命令 声明这是shel l文件
第三步:添加到定时执行序列中
1、命令行输入 crontab -e 编辑执行序列
2、内容如 40 18 * * * bash /home/worldbackup.sh

以上是关于linux 定时执行shell的主要内容,如果未能解决你的问题,请参考以下文章

linux 定时执行shell

linux 下cron定时任务为啥没执行

如何设置PowerShell脚本定时执行

linux定时任务每天的0点执行一次,怎么写

linux 定时执行shell

linux命令行下怎么定时执行一个命令?