1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-01-07 13:40:17 +02:00

Merge branch 'master' into pgpro-2573

This commit is contained in:
Grigory Smolkin 2019-03-29 22:11:51 +03:00
commit c230189b75
3 changed files with 38 additions and 8 deletions

View File

@ -15,6 +15,7 @@ As compared to other backup solutions, `pg_probackup` offers the following benef
* Taking backups from a standby server to avoid extra load on the master server
* Extended logging settings
* Custom commands to simplify WAL log archiving
* External to PGDATA directories, such as directories with config files and scripts, can be included in backup
To manage backup data, `pg_probackup` creates a backup catalog. This directory stores all backup files with additional meta information, as well as WAL archives required for [point-in-time recovery](https://postgrespro.com/docs/postgresql/current/continuous-archiving.html). You can store backups for different instances in separate subdirectories of a single backup catalog.
@ -40,7 +41,6 @@ Regardless of the chosen backup type, all backups taken with `pg_probackup` supp
* Creating backups from a remote server is currently not supported.
* The server from which the backup was taken and the restored server must be compatible by the [block_size](https://postgrespro.com/docs/postgresql/current/runtime-config-preset#GUC-BLOCK-SIZE) and [wal_block_size](https://postgrespro.com/docs/postgresql/current/runtime-config-preset#GUC-WAL-BLOCK-SIZE) parameters and have the same major release number.
* Microsoft Windows operating system support is in beta stage.
* Configuration files outside of PostgreSQL data directory are not included into the backup and should be backed up separately.
## Installation and Setup
### Linux Installation

View File

@ -1,7 +1,7 @@
import unittest
import os
from .helpers.ptrack_helpers import ProbackupTest, ProbackupException
import datetime
module_name = 'logging'
@ -15,10 +15,8 @@ class LogTest(ProbackupTest, unittest.TestCase):
fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),
initdb_params=['--data-checksums'],
pg_options={
'wal_level': 'replica'}
)
initdb_params=['--data-checksums'])
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
self.init_pb(backup_dir)
self.add_instance(backup_dir, 'node', node)
@ -41,4 +39,36 @@ class LogTest(ProbackupTest, unittest.TestCase):
gdb.continue_execution_until_exit()
# Clean after yourself
self.del_test_dir(module_name, fname)
self.del_test_dir(module_name, fname)
def test_log_filename_strftime(self):
fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),
initdb_params=['--data-checksums'])
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
self.init_pb(backup_dir)
self.add_instance(backup_dir, 'node', node)
node.slow_start()
self.set_config(
backup_dir, 'node',
options=['--log-rotation-age=1d'])
self.backup_node(
backup_dir, 'node', node,
options=[
'--stream',
'--log-level-file=VERBOSE',
'--log-filename=pg_probackup-%a.log'])
day_of_week = datetime.datetime.today().strftime("%a")
path = os.path.join(
backup_dir, 'log', 'pg_probackup-{0}.log'.format(day_of_week))
self.assertTrue(os.path.isfile(path))
# Clean after yourself
self.del_test_dir(module_name, fname)

View File

@ -9,8 +9,8 @@ module_name = 'snapfs'
class SnapFSTest(ProbackupTest, unittest.TestCase):
# @unittest.skip("skip")
# @unittest.expectedFailure
@unittest.skipUnless(ProbackupTest.enterprise, 'skip')
def test_snapfs_simple(self):
"""standart backup modes with ARCHIVE WAL method"""
fname = self.id().split('.')[3]