//进入本地工程目录
.openshift/cron/minutely
//新建自动重启脚本
restart.sh
#复制这段代码到restart.sh
2 | export TZ= 'Asia/Shanghai' |
3 | curl -I ${OPENSHIFT_APP_DNS} 2> /dev/null | head -1 | grep -q '200|301|302' |
7 | echo "`date +" %Y-%m-%d %H:%M:%S "` down" >> ${OPENSHIFT_DATA_DIR}web_error.log |
11 | echo "`date +" %Y-%m-%d %H:%M:%S "` restarting…" >> ${OPENSHIFT_DATA_DIR}web_error.log |
12 | /usr/bin/gear stop 2>&1 /dev/null |
13 | /usr/bin/gear start 2>&1 /dev/null |
14 | echo "`date +" %Y-%m-%d %H:%M:%S "` restarted!!!" >> ${OPENSHIFT_DATA_DIR}web_error.log |
17 | echo "`date +" %Y-%m-%d %H:%M:%S "` is ok" > ${OPENSHIFT_DATA_DIR}web_run.log |
#复制这段代码到restart.sh
//使用ssh赋予脚本711权限
chmod 711 restart.sh