自动化git更新初步实践之crontab

星期一, 2017-02-20 | Author: Lee | JAVA-and-J2EE | 4,639 views

启用crontab做自动化构建git代码步骤如下:

1. crontab -e 每5分钟执行一次输出执行结果到日志文件中

*/5 * * * * /home/wx.sh >> /home/wx.log 2>&1

2.踩坑wx.sh 的环境变量问题 一定要source /etc/profile 文件,其他指令也最好绝对地址

#!/bin/sh
source /etc/profile
cd /home/www/
/usr/local/git/bin/git pull
chown -R www:www /home/www

完毕

Tags: ,

文章作者: Lee

本文地址: https://www.pomelolee.com/1698.html

除非注明,Pomelo Lee文章均为原创,转载请以链接形式标明本文地址

No comments yet.

Leave a comment

Search

文章分类

Links

Meta