-
-
Save eugenpirogoff/1b811ecf57a0215073f1515b20d2f51c to your computer and use it in GitHub Desktop.
Git pull inside root crontab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# crontab (by executing sudo opens up root crontab) | |
sudo crontab -e | |
# every 1 minute pull changes (if any) and replace $user with real username | |
*/1 * * * * su -s /bin/sh $user -c 'cd /var/www/html/src && /usr/bin/git pull origin master && /usr/bin/git checkout master' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment