3 # Script to update all the honours stuff on a regular basis
7 # Need to cd to the directory, otherwise nothing will work
8 directory="/home/sam/Documents/University/honours/"
11 # Need to do this too. Apparently
13 eval $(ssh-agent) 2>/dev/null
14 ssh-add /home/sam/.ssh/honours 2>/dev/null
16 # This bit plots any open data files, so I can remotely view them
17 # TODO: Magically update all fils
18 # TODO: Actually label plots properly, you lazy bastard
19 plot="/home/sam/Documents/University/honours/research/TCS/plot.sh"
20 for i in $(find . -name "[0-9]*.dat" -mmin -60 -size +5k -print); do
24 $git pull git.ucc master # This is probably a good thing to do...
29 $git add thesis/proposal/*.tex
30 $git add thesis/proposal/*.pdf
31 $git add thesis/proposal/*.bib
35 #$git add course/semester2 # Don't do this; I will be putting lecture videos in this folder!
37 # This sets a commit message and commits. Commit will only be done if there are changed files.
38 fortune="/usr/games/fortune"
40 if [ "$message" == "" ]; then
41 message=$(echo "Automatic commit. $(date)"; echo ""; $fortune; echo "")
43 $git commit -m "$message"
44 if [ "$?" == 0 ]; then
45 echo "Commit at $(date)" >> commits.log
46 $git push git.ucc 2>&1 >> commits.log
49 kill -9 $SSH_AGENT_PID