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 files
18 # TODO: Actually label plots properly, you lazy bastard
19 # No longer auto plotting stuff, because I don't really check that often, and plots look better done through gnuplot than viewed as pngs
20 #plot="/home/sam/Documents/University/honours/research/TCS/plot.sh"
21 #for i in $(find . -name "[0-9]*.dat" -mmin -60 -size +5k -print); do
25 $git pull git.ucc master # This is probably a good thing to do...
30 $git add thesis/proposal/*.tex
31 $git add thesis/proposal/*.pdf
32 $git add thesis/proposal/*.bib
36 #$git add course/semester2 # Don't do this; I will be putting lecture videos in this folder!
38 # This sets a commit message and commits. Commit will only be done if there are changed files.
39 fortune="/usr/games/fortune"
41 if [ "$message" == "" ]; then
42 message=$(echo "Automatic commit. $(date)"; echo ""; $fortune; echo "")
44 $git commit -m "$message"
45 if [ "$?" == 0 ]; then
46 echo "Commit at $(date)" >> commits.log
47 $git push git.ucc 2>&1 >> commits.log
50 kill -9 $SSH_AGENT_PID