wiki:SCS_BACKUP_R5
Last modified 16 years ago Last modified on 07/22/09 09:35:08

Error: Macro BackLinksMenu(None) failed
compressed data is corrupt

Error: Macro TicketQuery(summary=SCS_BACKUP_R5, format=table, col=summary|owner|status|type|component|priority|effort|importance, rows=description|analysis_owners|analysis_reviewers|analysis_score|design_owners|design_reviewers|design_score|implementation_owners|implementation_reviewers|implementation_score|test_owners|test_reviewers|test_score|) failed
current transaction is aborted, commands ignored until end of transaction block

Analysis

Overview

Backup has been tested recently and works, but with loss of appearance.

Task requirements

  • Add trac appearence to the backup

Monthly backups

  • Test if the previous backup contains all needed information for restoring
    • Trac - wiki pages, settings, user accounts.
    • Svn - data, settings, user accounts.
    • Apache configurations
    • Postgres databases.
    • Build server configurations (Hudson)
    • Testlink setup
  • Add trac appearence to the backup
  • Modify the script if needed
  • Execute the scripts
  • Write the image on a dvd (if weekly backups are performed)

Weekly backups

  • Make weekly backups on a hard drive away from the office or on a DVD in a different location

Task result

Backup DVD(s) that are kept in different locations. Daily database backups, location should be listed here. If database is modified, backup before modifications.

Implementation idea

Use previous revisions of this tasks for locations of the scripts.

SCS_BACKUP_R4

How to demo

Explain what is done.

Design

  • Add trac skin to the back up script adding the following:
     ## Trac, testlink and svn[[BR]]
     cp -R /home/scs/svn/ /home/scs/backup/all/$dirname[[BR]]
     cp -R /home/scs/trac/ /home/scs/backup/all/$dirname[[BR]]
     cp -R /home/scs/testlink/ /home/scs/backup/all/$dirname[[BR]]
     cp -R /home/scs/nexus/ /home/scs/backup/all/$dirname[[BR]]
     '''cp -R /usr/lib/python2.5/site-packages/ $dirname'''[[BR]]
    
  • Verified the contents of the previous back up task.
  • Run the scripts twice and store the 2 DVDs at separate places.

Implementation

  • Previous back up contains all information needed for restore
  • Trac Skinis added to the back up script according to the design phase
  • The scripts were executed
  • As a result two disks were burned
  • They are kept in different locations
    • one at the office
    • one is kept in the Infrastructure Manager's home aka Pac
  • The script is executed every Sunday at 3 a.m. ЕЕТ. However we burn the DVDs ones a month.
  • Script
    #!/bin/bash
    dirname="/root/backup/`date +%Y-%m-%d`"
    
    mkdir $dirname
    mkdir $dirname/scs
    mkdir $dirname/build
    mkdir $dirname/build/.hudson
    mkdir $dirname/s2s
    mkdir $dirname/apache
    mkdir $dirname/postgres
    
    ## Trac, testlink, svn and python site packages
    cp -R /home/scs/svn/ $dirname/scs
    cp -R /home/scs/trac/ $dirname/scs
    cp -R /home/scs/testlink/ $dirname/scs
    cp -R /home/scs/nexus/ $dirname/scs
    cp -R /usr/lib/python2.5/site-packages/ $dirname
    
    
    ## Apache virtual host
    cp /etc/apache2/sites-available/trac $dirname/apache/
    
    ## PstgreSQL database
    pg_dumpall -U scs -c -d > $dirname/postgres/pgdump
    
    ## Build server
    copy() {
       for file in `ls "$1$2"`
       do
          if [ $file = 'Sophie' ]
          then
             file="Sophie 2.0"
          fi
          if [ `echo "$1$2$file" | grep /sophie2/ | wc -l` -eq 0 ]
          then
             if [ -d "$1$2$file" ]
             then
                mkdir "$dirname/build/$2$file"
                copy "$1" "$2$file/"
             else
                cp "$1$2$file" "$dirname/build/$2$file"
             fi
          else
          mkdir "$1$2$file"
          fi
       done
    }
    
    copy /home/build   /.hudson/
    
    ## S2S server
    cp -R /home/s2s/sophie2server $dirname/s2s
    
    tar -pczf "$dirname".tar.gz $dirname
    rm -Rf $dirname
    
    #mkisofs -r -o  "$dirname".iso "$dirname".tar.gz
    #wodim  "$dirname".iso
    

Testing

(Place the testing results here.)

Comments

Restoring 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.