I am currently cleaning up a mess left by someone else on a CentOS 6 server. There is an application that is required to be backed up to a github account every 6 hours. There is a script that takes care of preparing the data and it takes care of the git add and git commit.
The git push is taken care of by an "expect" script. This was done so that the passphrase can be passed to the git push when the ssh asks for it. The user does not want to use an empty passphrase.
The script runs fine when run from the command line in a bash shell by the root user. I can see the files transferred to github.
When the script runs under a crontab created by root the script appears to run but the git push does not take place. If I manually run a git push, after the script has failed, I notice that the push that should have happened happens along with the manual one I have called from the command line. It appears that the push that should have happened in the script has been cached and not pushed to github.
Can anyone suggest what I am missing here? Is it possible to get a git push to work within a script like this?
Regards
Richard