linux定时任务每隔5分钟向文本追加一行

编写shell脚本

test.sh内容如下,上传到linux的root目录

更改文件权限

chmod  777   test.sh

编辑定时任务

crontab  -e

*/5    *  *  *  *    /root/test.sh

 

查看定时任务

crontab -l

 

删除定时任务

crontab -r

 

==========================================================

 cron的格式

*/5    *  *  *  *    /root/test.sh    每隔5分钟执行一次test.sh脚本

猜你喜欢

转载自www.cnblogs.com/moris5013/p/10906613.html