Created
March 5, 2013 09:32
-
-
Save kensei/5089066 to your computer and use it in GitHub Desktop.
git autofetch 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
#!/usr/bin/env bash | |
password="password" | |
sourcedest="/home/git/myproject" | |
cd $sourcedest | |
echo "Updating Source..." | |
expect <<- DONE | |
set timeout 240 | |
spawn git fetch -v --all | |
match_max 100000 | |
expect "Enter passphrase for key *: " | |
send -- "$password\r" | |
send -- "\r" | |
expect eof | |
DONE | |
echo $(git reset --hard origin/master) | |
echo $(git log -1 --oneline) |
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
LOG_DIR=/home/crontab/log | |
*/5 * * * * /home/bin/autogitfetch >> $LOG_DIR/auto-git-fetch.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment