From 6fef70277d885de99dfa22f6def0f78407813ee0 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Fri, 29 Mar 2019 22:09:52 +0300 Subject: [PATCH 1/2] remove limitation about external files from README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a356b81b..898c7d6a 100644 --- a/README.md +++ b/README.md @@ -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 From 2647c378412f30d4b4f5828f0374e09b18ff0666 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Fri, 29 Mar 2019 22:10:24 +0300 Subject: [PATCH 2/2] tests: minor changes to logging and snapfs tests --- tests/logging.py | 42 ++++++++++++++++++++++++++++++++++++------ tests/snapfs.py | 2 +- 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/tests/logging.py b/tests/logging.py index 173a977a..210a6f4f 100644 --- a/tests/logging.py +++ b/tests/logging.py @@ -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) \ No newline at end of file + 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) diff --git a/tests/snapfs.py b/tests/snapfs.py index a8acc835..3ea05e8e 100644 --- a/tests/snapfs.py +++ b/tests/snapfs.py @@ -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]