Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Git pull inside root crontab
# Git repository may not allow root to pull down updates
# Pull updates where $user is allowed to read/write remote.
# command line:
su -s /bin/sh $user -c 'cd /var/www/html/src && /usr/bin/git pull origin master'
# crontab (by executing sudo opens up root crontab)
sudo crontab -e
# every 1 minute pull changes (if any)
*/1 * * * * su -s /bin/sh $user -c 'cd /var/www/html/src && /usr/bin/git pull origin master'
@FlyCorp
Copy link

FlyCorp commented Apr 27, 2022

Show demais

@jazlopez
Copy link
Author

Sorry I didn't get the context of
your comment. @FlyCorp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment