This commit is contained in:
dylan 2023-08-20 17:00:26 +08:00
parent 72501bf6f4
commit 3f7143361b
2 changed files with 36 additions and 39 deletions

View File

@ -1,39 +0,0 @@
#!/usr/bin/env bash
#15 3 * * 3 jd_fixpull_.sh
#new Env('拉库失败修复');
## Build 20230429
echo -e '\n开始修复。。。\n'
DIR="$( cd "$( dirname $0 )" >/dev/null 2>&1 && pwd )"
#echo $DIR
function fix(){
if [[ -z "$(echo "$DIR"|grep 'main')" ]];then
if [[ -d /ql/repo/6dylan6_jdpro ]];then
rm -rf /ql/repo/6dylan6_jdpro
#ql repo https://ghproxy.com/https://github.com/6dylan6/jdpro.git "jd_|jx_|jddj_" "backUp" "^jd[^_]|USER|JD|function|sendNotify"
elif [[ -d /ql/data/repo/6dylan6_jdpro ]];then
rm -rf /ql/data/repo/6dylan6_jdpro
#ql repo https://ghproxy.com/https://github.com/6dylan6/jdpro.git "jd_|jx_|jddj_" "backUp" "^jd[^_]|USER|JD|function|sendNotify"
else
echo -e '无需修复,拉不动可能是代理问题'
#find /ql -maxdepth 2 -type d
return 1
fi
else
if [[ -d /ql/repo/6dylan6_jdpro_main ]];then
rm -rf /ql/repo/6dylan6_jdpro_main
#ql repo https://ghproxy.com/https://github.com/6dylan6/jdpro.git "jd_|jx_|jddj_" "backUp" "^jd[^_]|USER|JD|function|sendNotify" "main"
elif [[ -d /ql/data/repo/6dylan6_jdpro_main ]];then
rm -rf /ql/data/repo/6dylan6_jdpro_main
#ql repo https://ghproxy.com/https://github.com/6dylan6/jdpro.git "jd_|jx_|jddj_" "backUp" "^jd[^_]|USER|JD|function|sendNotify" "main"
else
echo -e '无需修复,拉不动可能是代理问题\n'
#find /ql -maxdepth 2 -type d
return 1
fi
fi
}
fix
[[ $(echo $?) -eq 0 ]] && echo -e '修复完成,再拉库试试!,如果还不行是网络或代理问题!!!'

36
jd_pullfix.py Normal file
View File

@ -0,0 +1,36 @@
"""
15 0 * * * jd_pullfix.py
new Env('拉库|更新问题修复');
"""
#!/usr/bin/env python3
# coding: utf-8
import os
def pullfix():
print('\n对拉库失败、拉库成功但更新不出任务等问题修复\n')
print('\n开始执行。。。\n')
dir_path = os.path.dirname(os.path.abspath(__file__))
if 'main' not in dir_path:
if os.path.isdir('/ql/repo/6dylan6_jdpro'):
os.system('rm -rf /ql/repo/6dylan6_jdpro')
elif os.path.isdir('/ql/data/repo/6dylan6_jdpro'):
os.system('rm -rf /ql/data/repo/6dylan6_jdpro')
else:
print('无需修复,拉不动可能是代理问题')
# os.system('find /ql -maxdepth 2 -type d')
return False
else:
if os.path.isdir('/ql/repo/6dylan6_jdpro_main'):
os.system('rm -rf /ql/repo/6dylan6_jdpro_main')
elif os.path.isdir('/ql/data/repo/6dylan6_jdpro_main'):
os.system('rm -rf /ql/data/repo/6dylan6_jdpro_main')
else:
print('无需修复,拉不动可能是代理问题\n')
# os.system('find /ql -maxdepth 2 -type d')
return False
return True
if pullfix():
print('修复完成,再拉库试试!,如果还不行是网络或代理问题!!!')