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 repo
although it for sure is - make sure cron uses
piuser
by verifying that* * * * * echo "$(date): $(whoami)" >> ~/mylog.log
showspiuser
in the logs - manually doing
git pull
aspiuser
works just fine
Thanks for any Ideas!