I'm trying to automate a job I'm duing daily by hand. I ended up writing a sh script to push a git repository.
the script is located at /home/autogit-project.sh
And looks like this:
#!/bin/sh
cd /var/www/project
git add *
timestamp(){
date +"%d.%m.%Y um %H:%M"
}
git commit -am "Auto Server Commit $(timestamp)"
git push --repo https://[user]:[password]@github.com/[organisation]/[repo].git
when running the script via $ sh autogit-project.sh
it works.
For testing purpose I want to run the script every minute. My Crontab looks like this:
@daily /home/anotherscriptthatworks.sh
* * * * * /home/autogit-project.sh
anotherscriptthatworks.sh
is in the same directory with the same user right. the script writes a log file, so I know it works. My autogit-project.sh
however does not and I'm struggling to find out why. Any ideas or help is very welcome.