ウェブサイトを自動バックアップするスクリプトを作成しました。このスクリプトはリソースをgithubにプッシュします。crontabにコードを書いて、自動実行できるようにしました。ただし、リソースをプッシュできない理由はわかりません。
ヘッドが変更されていることがわかります.git
(つまり、コミットが成功したことを意味します)。問題は、ユーザー名の誤った使用にあると思います。
以下の情報は、自動バックアップ スクリプトの出力です。
Committer: root <root@xxxx.(none)>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config --global user.name "Your Name"
git config --global user.email you@example.com
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
1 file changed, 14 insertions(+), 14 deletions(-)
どうすれば対処できますか?
crontab のコマンド:
*/2 * * * * root /var/backWiki.sh >/home/xxx/Tmp/4.txt
このシェル スクリプトの主要部分は次のとおりです。
git pull originTyl master
git add -A
echo '2'
git commit -a -m $nowtime
echo '1'
git push originTyl master
echo '3'
origninTyl は次のことを意味します。
`[remote "originTyl"]`
`url = https://accoutName:password@github.com/xxxx/xxxx.git`
`fetch = +refs/heads/*:refs/remotes/originTyl/*`