35 | | ^(Describe your design here.)^ |
| 35 | * Add trac skin to the back up script adding the following:[[BR]] |
| 36 | {{{ |
| 37 | #!sh |
| 38 | ## Trac, testlink and svn[[BR]] |
| 39 | cp -R /home/scs/svn/ /home/scs/backup/all/$dirname[[BR]] |
| 40 | cp -R /home/scs/trac/ /home/scs/backup/all/$dirname[[BR]] |
| 41 | cp -R /home/scs/testlink/ /home/scs/backup/all/$dirname[[BR]] |
| 42 | cp -R /home/scs/nexus/ /home/scs/backup/all/$dirname[[BR]] |
| 43 | '''cp -R /usr/lib/python2.5/site-packages/ $dirname'''[[BR]] |
| 44 | }}} |
| 45 | * Verified the contents of the previous back up task. |
| 46 | * Run the scripts twice and store the 2 DVDs at separate places. |
38 | | ^(Describe and link the implementation results here (from the wiki or the repository).)^ |
| 49 | * Previous back up contains all information needed for restore |
| 50 | * Trac Skinis added to the back up script according to the design phase |
| 51 | * The scripts were executed |
| 52 | * As a result two disks were burned |
| 53 | * They are kept in different locations |
| 54 | * one at the office |
| 55 | * one is kept in the Infrastructure Manager's home aka Pac |
| 56 | * The script is executed every Sunday at 3 a.m. ЕЕТ. However we burn the DVDs ones a month. |
| 57 | * Script |
| 58 | {{{ |
| 59 | #!sh |
| 60 | #!/bin/bash |
| 61 | dirname="/root/backup/`date +%Y-%m-%d`" |
| 62 | |
| 63 | mkdir $dirname |
| 64 | mkdir $dirname/scs |
| 65 | mkdir $dirname/build |
| 66 | mkdir $dirname/build/.hudson |
| 67 | mkdir $dirname/s2s |
| 68 | mkdir $dirname/apache |
| 69 | mkdir $dirname/postgres |
| 70 | |
| 71 | ## Trac, testlink, svn and python site packages |
| 72 | cp -R /home/scs/svn/ $dirname/scs |
| 73 | cp -R /home/scs/trac/ $dirname/scs |
| 74 | cp -R /home/scs/testlink/ $dirname/scs |
| 75 | cp -R /home/scs/nexus/ $dirname/scs |
| 76 | cp -R /usr/lib/python2.5/site-packages/ $dirname |
| 77 | |
| 78 | |
| 79 | ## Apache virtual host |
| 80 | cp /etc/apache2/sites-available/trac $dirname/apache/ |
| 81 | |
| 82 | ## PstgreSQL database |
| 83 | pg_dumpall -U scs -c -d > $dirname/postgres/pgdump |
| 84 | |
| 85 | ## Build server |
| 86 | copy() { |
| 87 | for file in `ls "$1$2"` |
| 88 | do |
| 89 | if [ $file = 'Sophie' ] |
| 90 | then |
| 91 | file="Sophie 2.0" |
| 92 | fi |
| 93 | if [ `echo "$1$2$file" | grep /sophie2/ | wc -l` -eq 0 ] |
| 94 | then |
| 95 | if [ -d "$1$2$file" ] |
| 96 | then |
| 97 | mkdir "$dirname/build/$2$file" |
| 98 | copy "$1" "$2$file/" |
| 99 | else |
| 100 | cp "$1$2$file" "$dirname/build/$2$file" |
| 101 | fi |
| 102 | else |
| 103 | mkdir "$1$2$file" |
| 104 | fi |
| 105 | done |
| 106 | } |
| 107 | |
| 108 | copy /home/build /.hudson/ |
| 109 | |
| 110 | ## S2S server |
| 111 | cp -R /home/s2s/sophie2server $dirname/s2s |
| 112 | |
| 113 | tar -pczf "$dirname".tar.gz $dirname |
| 114 | rm -Rf $dirname |
| 115 | |
| 116 | #mkisofs -r -o "$dirname".iso "$dirname".tar.gz |
| 117 | #wodim "$dirname".iso |
| 118 | }}} |