I am using crontab to setup cronjob in order to pull from git, manually these commands work but from cronjob the seem not to:
- cd /var/www/project/ && git pull
How can that be fixed?
It's likely due to sudo permissions required on /var/.
Make a shell script cron_pull.sh anywhere and run it on cron.
In cron_pull.sh:
#!/bin/bash
cd /var/www/project
git pull
Run
sudo chmod +x cron_pull.sh
In sudo crontab -e:
* * * * * /path/to/cron_pull.sh
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With