Changes between Version 2 and Version 3 of SCS_BACKUP_R5


Ignore:
Timestamp:
07/22/09 09:35:08 (16 years ago)
Author:
pacitu
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TabularUnified SCS_BACKUP_R5

    v2 v3  
    3333 
    3434= Design = 
    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. 
    3647 
    3748= Implementation = 
    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 
     61dirname="/root/backup/`date +%Y-%m-%d`" 
     62 
     63mkdir $dirname 
     64mkdir $dirname/scs 
     65mkdir $dirname/build 
     66mkdir $dirname/build/.hudson 
     67mkdir $dirname/s2s 
     68mkdir $dirname/apache 
     69mkdir $dirname/postgres 
     70 
     71## Trac, testlink, svn and python site packages 
     72cp -R /home/scs/svn/ $dirname/scs 
     73cp -R /home/scs/trac/ $dirname/scs 
     74cp -R /home/scs/testlink/ $dirname/scs 
     75cp -R /home/scs/nexus/ $dirname/scs 
     76cp -R /usr/lib/python2.5/site-packages/ $dirname 
     77 
     78 
     79## Apache virtual host 
     80cp /etc/apache2/sites-available/trac $dirname/apache/ 
     81 
     82## PstgreSQL database 
     83pg_dumpall -U scs -c -d > $dirname/postgres/pgdump 
     84 
     85## Build server 
     86copy() { 
     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 
     108copy /home/build   /.hudson/ 
     109 
     110## S2S server 
     111cp -R /home/s2s/sophie2server $dirname/s2s 
     112 
     113tar -pczf "$dirname".tar.gz $dirname 
     114rm -Rf $dirname 
     115 
     116#mkisofs -r -o  "$dirname".iso "$dirname".tar.gz 
     117#wodim  "$dirname".iso 
     118}}} 
    39119 
    40120= Testing = 
     
    42122 
    43123= Comments = 
    44 ^(Write comments for this or later revisions here.) 
     124Restoring the scs, s2s and apache are as simple as copying the contents of the back-up to the corresponding catalogs in the Server. The build restore is a bit more tricky  because you have to checkout the repository in the $HUDSON_HOME/".hudson/jobs/Sophie\ 2.0/sophie2/trunk" before the server can run properly. ( you also copy the contents of the catalog into the $HUDSON_HOME) The postgres database can be restored with the  "pg_restore -c -f $FILE" command executed as root. Finally the trac environment can be restored on the Sophie2 server in the same manner, but if we have to move the servers to another machine, then only the files for the trac look and feel should be copied all the other things should be installed properly.