|
|
@@ -191,7 +191,7 @@ def start_postgres_service():
|
|
|
# -------------------------
|
|
|
# 基础备份(pg_basebackup)
|
|
|
# -------------------------
|
|
|
-def perform_base_backup(pg_superuser='postgres', pg_password='zhanglei'):
|
|
|
+def perform_base_backup(pg_superuser='postgres', pg_password='abc@1234'):
|
|
|
"""执行基础备份"""
|
|
|
pg_bin = get_postgres_bin_path()
|
|
|
if not pg_bin:
|
|
|
@@ -237,7 +237,7 @@ def perform_base_backup(pg_superuser='postgres', pg_password='zhanglei'):
|
|
|
# -------------------------
|
|
|
# 检查数据库状态
|
|
|
# -------------------------
|
|
|
-def check_database_status(dbname='postgres', user='postgres', password='zhanglei',
|
|
|
+def check_database_status(dbname='postgres', user='postgres', password='abc@1234',
|
|
|
host='localhost', port=5432):
|
|
|
"""
|
|
|
检查数据库状态
|
|
|
@@ -418,7 +418,7 @@ def parse_target_time(t):
|
|
|
# -------------------------
|
|
|
# 检查恢复进度(通过数据库)
|
|
|
# -------------------------
|
|
|
-def check_recovery_progress(dbname='postgres', user='postgres', password='zhanglei',
|
|
|
+def check_recovery_progress(dbname='postgres', user='postgres', password='abc@1234',
|
|
|
host='localhost', port=5432, target_dt=None):
|
|
|
"""
|
|
|
检查恢复进度
|
|
|
@@ -471,9 +471,9 @@ def check_recovery_progress(dbname='postgres', user='postgres', password='zhangl
|
|
|
|
|
|
def restore_to_point_in_time(target_time, base_backup_dir,
|
|
|
wal_archive_dir=r"E:\code\backup\postgres\wal_archive",
|
|
|
- pg_superuser='postgres', pg_password='zhanglei',
|
|
|
+ pg_superuser='postgres', pg_password='abc@1234',
|
|
|
db_check_name='postgres', db_check_user='postgres',
|
|
|
- db_check_password='zhanglei', db_host='localhost',
|
|
|
+ db_check_password='abc@1234', db_host='localhost',
|
|
|
db_port=5432, max_wait_minutes=30):
|
|
|
"""
|
|
|
执行时间点恢复 (PITR)
|