Index: openacs-4/packages/acs-core-docs/www/backup-recovery.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/backup-recovery.html,v diff -u -r1.1.2.3 -r1.1.2.4 --- openacs-4/packages/acs-core-docs/www/backup-recovery.html 7 Apr 2003 16:59:25 -0000 1.1.2.3 +++ openacs-4/packages/acs-core-docs/www/backup-recovery.html 15 Apr 2003 17:03:01 -0000 1.1.2.4 @@ -1,10 +1,10 @@ -Backup and Recovery

Backup and Recovery

+Backup and Recovery

Backup and Recovery

by Don Baccus with additions by Joel Aufrecht
OpenACS docs are written by the named authors, but may be edited by OpenACS documentation staff. -

Backup Strategy

+

Backup Strategy

The purpose of backup is to enable recovery. Backup and recovery are always risky; here are some steps that minimize the chance recovery is necessary: @@ -38,16 +38,16 @@ /web/servicename/database-backup, then you can apply standard file-based backup strategies to the root directory. -

Set up Nightly Postgres Exports

A quick way to automate database backup is a cron job. +

Set up Nightly Postgres Exports

A quick way to automate database backup is a cron job. (This should moved into OpenACS's scheduled task project so that - it's integrated with OpenACS's alerts and such.)

[service0@yourserver service0]$ export EDITOR=emacs;crontab -e

Add this line to the file. The numbers and stars at the beginning are cron columns that specify when the program should be run - in this case, whenever the minute is 0 and the hour is 1, i.e., 1:00 am every day.

0 1 * * * /usr/local/pgsql/bin/pg_dump -f /web/service0/database-backup/service0_$(date +%Y-%m-%d).dmp service0

Back up the file system

Here's a quick manual way to back up a reference install - + it's integrated with OpenACS's alerts and such.)

[service0@yourserver service0]$ export EDITOR=emacs;crontab -e

Add this line to the file. The numbers and stars at the beginning are cron columns that specify when the program should be run - in this case, whenever the minute is 0 and the hour is 1, i.e., 1:00 am every day.

0 1 * * * /usr/local/pgsql/bin/pg_dump -f /web/service0/database-backup/service0_$(date +%Y-%m-%d).dmp service0

Back up the file system

Here's a quick manual way to back up a reference install - it should be replaced by an automated script within OpenACS. The command excludes the auto-generated supervise directory, which is unneccesary and has complicated permissions. Make sure that you are using the cron job to back up the database to a file in /web/service0/database-backup so that the tar command will include the database.

[root@yourserver root]# su - service0
 [service0@yourserver service0]$ tar -cpsj --exclude /web/service0/etc/daemontools/supervise --file /tmp/service0-backup.tar.bz2 /web/service0/ 
 tar: Removing leading `/' from member names
-[service0@yourserver service0]$

Testing

On a test service, make sure that your backup-recovery process work. After backing up the database and file system, delete the service as detailed below and then recover it.

[root@yourserver root]# svc -d /service/service0
+[service0@yourserver service0]$

Testing

On a test service, make sure that your backup-recovery process work. After backing up the database and file system, delete the service as detailed below and then recover it.

[root@yourserver root]# svc -d /service/service0
 [root@yourserver root]# mv /web/service0/ /web/service0.lost
 [root@yourserver root]# rm /service/service0
 rm: remove symbolic link `/service/service0'? y
@@ -62,7 +62,7 @@
 DROP USER
 [postgres@yourserver pgsql]$ exit
 logout
-[root@yourserver root]#

Recovery

  1. Restore the operating system and required software. +[root@yourserver root]#

Recovery

  1. Restore the operating system and required software. You can do this with standard backup processes or by keeping copies of the install material (OS CDs, OpenACS tarball and supporting software) and repeating the install guide.

  2. Restore the OpenACS service. Assuming the user already exists, restore the database and files from backup and restore the daemontools link. (Because of a bug in Postgres backup-recovery, not all database objects are created in the correct order. To compensate, pre-creating some objects usually work.)

    [root@yourserver root]# su - postgres
    @@ -87,8 +87,8 @@
     [root@yourserver root]# ln -s /web/service0/etc/daemontools /service/service0
     [root@yourserver root]# sleep 10
     [root@yourserver root]# svgroup web /service/service0
    -[root@yourserver root]#

Other Backup Strategies

Earlier strategies, included here because this section - hasn't been fully updated yet.

Set Up Nightly Oracle Exports

+[root@yourserver root]#

Other Backup Strategies

Earlier strategies, included here because this section + hasn't been fully updated yet.

Set Up Nightly Oracle Exports

(This has not yet been updated to fit with the Reference install. To do so, edit the backup script to save the backup file in /web/servicename/database-backup). @@ -179,7 +179,7 @@ root:~# crontab -l | grep export-oracle 0 23 * * * /usr/sbin/export-oracle root:~# exit -; Logout

If you see the line, go ahead and log out.

Set up nightly Postgres exports

+; Logout

If you see the line, go ahead and log out.

Set up nightly Postgres exports

(This is not required for the Reference install.) Dowload this script to /tmp. At the top of the script @@ -213,4 +213,4 @@ joeuser:~$ restart-aolserver birdnotes

That's it! The script will email you with each successful backup (or if it fails, it will send you an email with the reason) -

($Id$)
View comments on this page at openacs.org
+

($Id$)
View comments on this page at openacs.org