Coder Social home page Coder Social logo

atorik / pg_rman Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ossc-db/pg_rman

0.0 1.0 0.0 1.01 MB

Backup and restore management tool for PostgreSQL

Home Page: http://ossc-db.github.io/pg_rman/index.html

License: Other

Makefile 0.24% C 75.01% Shell 24.75%

pg_rman's Introduction

pg_rman

pg_rman is an online backup and restore tool for PostgreSQL.

The goal of the pg_rman project is to provide a method for online backup and PITR that is as easy as pg_dump. Also, it maintains a backup catalog per database cluster. Users can maintain old backups including archive logs with one command.

Branches

There are several branches within pg_rman repository in order to work with different PostgreSQL server versions without introducing server version check code blocks. Please choose a branch to match the PostgreSQL version you will be building pg_rman against.

  • master : branch for latest PostgreSQL development version Build Status
  • REL9_6_STABLE : branch for PostgreSQL 9.6 Build Status
  • REL9_5_STABLE : branch for PostgreSQL 9.5 Build Status
  • REL9_4_STABLE : branch for PostgreSQL 9.4 Build Status
  • REL9_3_STABLE : branch for PostgreSQL 9.3 Build Status
  • REL9_2_STABLE : branch for PostgreSQL 9.2 Build Status
  • pre-9.2 : branch for PostgreSQL 9.1 and before Build Status

How to use

To take an online backup, use the backup command:

$ pg_rman backup --backup-mode=full --with-serverlog
INFO: copying database files
INFO: copying archived WAL files
INFO: copying server log files
INFO: backup complete
INFO: Please execute 'pg_rman validate' to verify the files are correctly copied.

To list all the backups taken so far, use the show command:

$ pg_rman show
 ==========================================================
 StartTime           Mode  Duration    Size   TLI  Status
 ==========================================================
 2015-03-27 14:59:47  FULL        0m  3404kB     3  OK
 2015-03-27 14:59:19  ARCH        0m    26kB     3  OK
 2015-03-27 14:59:00  ARCH        0m    26kB     3  OK
 2015-03-27 14:58:46  FULL        0m  3516kB     3  OK
 2015-03-27 11:43:31  INCR        0m    54kB     1  OK
 2015-03-27 11:43:19  INCR        0m    69kB     1  OK
 2015-03-27 11:43:04  INCR        0m   151kB     1  OK
 2015-03-27 11:42:56  INCR        0m    96kB     1  OK
 2015-03-27 11:34:55  FULL        0m  5312kB     1  OK

To restore from a backup, use the restore command. Note that pg_rman itself generates the recovery.conf file required to perform PostgreSQL PITR.

$ pg_ctl stop -m immediate
$ pg_rman restore
$ cat $PGDATA/recovery.conf
# recovery.conf generated by pg_rman 1.3.3
restore_command = 'cp /home/postgres/arclog/%f %p'
recovery_target_timeline = '1'
$ pg_ctl start

To see more options to use with each command, run pg_rman --help.

Also, see the documentation for detailed usage:

http://ossc-db.github.io/pg_rman/index.html

How to build and install from source code

Go to the top directory of pg_rman source tree and run the following commands:

 $ make
 # make install

The following packages need to be installed as a prerequisite.

  • zlib-devel

How to run regression tests

Start PostgreSQL server and run the below command.

 $ make installcheck

pg_rman's People

Contributors

bwtakacy avatar amitlan avatar oknj avatar xctools avatar vinpokale avatar ooyamams avatar michaelpq avatar atorik avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.