linux shell定时任务

1.用到crontab,需要初始化命令包
yum install vixie-cron
yum install crontabs
2.启动服务
systemctl start crond.service
3.编写shell文件
#/bin/sh
echo "test" >> /home/app/log.txt
保存 test.shell
4.进入编写定时触发器
crontab -e (类似于vi文件操作)
52 9 * * * sh /home/app/test.shell
:wq 退出
只出现crontab: installing new crontab 表示设置成功 5. tail -f log.txt 监听文件.....

  

posted @ 2021-02-01 09:59  SimpleSmile  阅读(454)  评论(0编辑  收藏  举报