Automatic commit at Wed Jul 25 17:33:01 WST 2012
[matches/honours.git] / update.sh
1 #!/bin/bash
2
3 # Script to update all the honours stuff on a regular basis
4
5 # Need to cd to the directory, otherwise nothing will work
6 directory="/home/sam/Documents/University/honours/"
7 cd "$directory" 
8
9 # Need to do this too. Apparently
10 git="/usr/bin/git"
11 eval $(ssh-agent) 2>/dev/null
12 ssh-add /home/sam/.ssh/honours 2>/dev/null
13
14 $git add update.sh
15 $git add papers
16 $git add research
17 $git add thesis/proposal/*.tex
18 $git add thesis/proposal/*.pdf
19 $git add thesis/proposal/*.bib
20 $git add thesis/*.tex
21 $git add thesis/*.pdf
22 $git add thesis/*.bib
23 $git add course/semester2
24
25 $git commit -m "Automatic commit at $(date)"
26 if [ "$?" == 0 ]; then
27         echo "Commit at $(date)" >> commits.log
28         $git push git.ucc 2>&1 >> commits.log
29 fi
30
31 kill -9 $SSH_AGENT_PID

UCC git Repository :: git.ucc.asn.au