Centos7 linux定时任务

1、参考

CentOS 7 定时任务 crontab 入门

Centos 利用crontab定时执行任务及配置方法

2、

crontab -l #查看当前用户定时任务
crontab -e #编辑当前用户定时任务

# prod backup database
0 2 * * * cd /data/xxx && /usr/bin/sh xxx_backup.sh
# prod auto update manage code
# * * * * * cd /data/xxx/ && source /etc/profile && /usr/bin/sh xxx_auto_update_manage.sh
# temp auto update manage code
# * * * * * cd /data/xxx_temp/ && source /etc/profile && /usr/bin/sh xxx_auto_update_manage.sh
# temp auto update spring service
# * * * * * cd /data/xxx_temp/ && source /etc/profile && /usr/bin/sh xxx_auto_update.sh
# y4_xxx auto update
# * * * * * cd /data/y4_xxx/ && source /etc/profile && /usr/bin/sh au-auto-update.sh
# * * * * * sleep 10; cd /data/y4_xxx/ && source /etc/profile && /usr/bin/sh au-auto-update.sh
# * * * * * sleep 20; cd /data/y4_xxx/ && source /etc/profile && /usr/bin/sh au-auto-update.sh
# * * * * * sleep 30; cd /data/y4_xxx/ && source /etc/profile && /usr/bin/sh au-auto-update.sh
# * * * * * sleep 40; cd /data/y4_xxx/ && source /etc/profile && /usr/bin/sh au-auto-update.sh
# * * * * * sleep 50; cd /data/y4_xxx/ && source /etc/profile && /usr/bin/sh au-auto-update.sh
# prod xxx_new backup database
0 2 * * * cd /data/xxx_new && /usr/bin/sh db_backup_xxx_new.sh
posted @   一只桔子2233  阅读(87)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
历史上的今天:
2019-06-17 jquery 五星评价(图片实现)
点击右上角即可分享
微信分享提示