Main function wrapping all work.

Starts with getting list of compressions that have to be done, then it chooses where to compress to (important if we have remote-only destination), then it makes actual backup, and delivers to all destinations.


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


Helper function which waits for file to appear.

It will return only if the file appeared.

Return value is name of file.


Chooses single local destination for every compression schema required by destinations specifications.

In case some compression schema exists only for remote destination, local temp directory is created in --temp-dir location.


Starts set of filehandles, which write to file, or to compression program, to create final archives.

Each compression schema gets its own filehandle, and printing data to it, will pass it to file directly or through compression program that has been chosen based on command line arguments.


Helper function. Takes no arguments. Uses pg_tblspc directory and returns a listref of the physical locations for tar to include in the backup as well as a listref of the transform regexs that it will need to apply in order for those directories to get untarred to the correct location from pg_tblspc's perspective.


Helper function, which takes filetype and compression schema to use, and returns generated filename (based on filename-template command line option).


Worker function which does all of the actual tar, and sending data to compression filehandles (should be opened before).

Takes hash (not hashref) as argument, and uses following keys from it:

  • tar_dir - arrayref with list of directories to compress

  • work_dir - what should be current working directory when executing tar

  • excludes - optional key, that (if exists) is treated as arrayref of shell globs (tar dir) of items to exclude from backup

  • transform - optional key, that (if exists) is treated as value for --transform option for tar

If tar will print anything to STDERR it will be logged. Error status code is ignored, as it is expected that tar will generate errors (due to files modified while archiving).

Requires following keys in $self:

  • nice-path

  • tar-path


Simple wrapper to have single point to call to deliver backups to all requested backups.


Copies backups to all local destinations which are not also base destinations for their respective compressions.


Delivers backups to remote destinations using rsync program.