On a raspberry with user piuser I have a git repo ~/myfiles/gitrepo, accessing git via ssh, which works just fine with git pull when done manually.
However I want to do this automatically via a cron job, for which i use
* * * * * cd ~/myfiles/gitrepo/ && git pull
the logs say classic git no permission:
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
how can I get this to work?
what i tried so far:
- check replies from Git auto-pull using cronjob. this resulted in
directory not a git repoalthough it for sure is - make sure cron uses
piuserby verifying that* * * * * echo "$(date): $(whoami)" >> ~/mylog.logshowspiuserin the logs - manually doing
git pullaspiuserworks just fine
Thanks for any Ideas!