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 @ 2023-06-17 18:14  一只桔子2233  阅读(75)  评论(0编辑  收藏  举报