【发布时间】:2014-11-24 07:58:01
【问题描述】:
整个脚本运行良好。我还要注意,如果我将 cron 作业复制并粘贴到 shell 中并手动运行它,它不会出现任何问题。
Base = '/home/user/git/'
GIT_out = Base + ("git_file.txt")
FILE_NAME = Base + 'rules/file.xml'
CD_file = open(Base + "rules/reports/CD.txt", 'r')
os.chdir(Base + 'rules')
gitFetchPull = "git fetch --all ;sleep 3 ; git pull --all"
git1 = subprocess.Popen(gitFetchPull, shell=True, stdout=subprocess.PIPE)
gitOut = git1.stdout.read()
print(gitOut)
当我从 cron 读取输出时,它似乎无法进行身份验证
Received disconnect from 172.17.3.18: 2: Too many authentication failures for tyoffe4
fatal: The remote end hung up unexpectedly
error: Could not fetch origin
定时任务
* * * /usr/bin/python /home/tyoffe4/git/rules/reports/cd_release.py >/home/tyoffe4/git/rules/reports/cd_release.out 2>&1
【问题讨论】:
-
什么是 git remotes 配置?你用什么交通工具?