CentOS 添加定时任务

sudo crontab -uroot -e

#加入下面这一行, :wq 保存退出 [每分钟执行一次]
* * * * * /home/centos/sh/a.sh >> /home/centos/sh/a.log 2>&1
cd /home/centos/sh
touch a.sh
vi a.sh

#输入下面的脚本
curl 127.0.0.1:8080
echo '定时任务'

:wq 保存退出

 

posted @ 2022-05-30 17:55  喵喵2023  Views(207)  Comments(0Edit  收藏  举报