def archivepgsql_main(): options, args = archivepgsql_handle_args() conf = get_config_from_filename_and_set_up_logging(options.config_file) data_dir = get_data_dir(conf) with TemporaryDirectory(suffix='archivepgsql') as tempdir: tag = generate_tag() archive_dst_path = join(tempdir, 'pgsql.snapshot.tar') repo = get_Snapshot_repository(conf) if options.dry_run: print("Dry Run") return else: perform_backup(data_dir, archive_dst_path, tag, repo)
def will_raise_MissingDataDirError(): get_data_dir(self.config)
def get_wal_filename(config, wal_path): data_dir = get_data_dir(config) return os.path.join(data_dir, wal_path)