new()

Object contstructor.

Since all OmniPITR programs are based on object, and they start with doing the same things (namely reading and validating command line arguments) - this is wrapped in here, to avoid code duplication.

Constructor also handles pid file creation, in case it was requested.

check_debug()

Internal method providing --debug option handling to every omnipitr program.

If *first* argument to omnipitr program it will print to stderr all arguments, and environment variables.

run()

Just a stub method, that has to be overriden in subclasses.

verbose()

Shortcut to make code a bit nicer.

Returns values of (command line given) verbose switch.

log()

Shortcut to make code a bit nicer.

Returns logger object.

prepare_temp_directory()

Helper function, which builds path for temp directory, and creates it.

Path is generated by using given temp-dir and 'omnipitr-backup-master' named.

For example, for temp-dir '/tmp' used temp directory would be /tmp/omnipitr-backup-master.

If any arguments are passed - they are treated as subdirectories. For example, in above example, if ("xxx", "yyy") was passed, generated directory would be /tmp/omnipitr-backup-master/xxx/yyy.

DESTROY()

Destructor for object - removes temp directory on program exit.

get_list_of_all_necessary_compressions()

Scans list of destinations, and gathers list of all compressions that have to be made.

This is to be able to compress file only once even when having multiple destinations that require compressed format.

This function is used by all programs that need to compress "stuff" - omnipitr-archive, omnipitr-backup-master and omnipitr-backup-slave.

get_control_data()

Calls pg_controldata, and parses its output.

Verifies that output contains 2 critical pieces of information:

  • Latest checkpoint's REDO location

  • Latest checkpoint's TimeLineID