Last active
August 29, 2015 14:05
-
-
Save battis/598cdbbb36eecb979e4d to your computer and use it in GitHub Desktop.
A handy little shell script to schedule with crontab to regularly commit the latest version of a web server to Github.
This file contains hidden or 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
#!/bin/bash | |
logfile=/var/www/git.log | |
exec >> $logfile 2>&1 | |
date +"%Y-%m-%d %r" | |
cd /var/www | |
git fetch -q origin | |
git merge origin/master | |
git submodule update --recursive | |
git add -A . | |
git commit -q -m 'Auto Backup' | |
git push -q origin master | |
echo "---" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment