-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.example.yaml
More file actions
139 lines (124 loc) · 5.55 KB
/
config.example.yaml
File metadata and controls
139 lines (124 loc) · 5.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# PostgreSQL Backup Configuration
# SSH connection settings for the production server
ssh:
host: "prod-server.example.com"
port: 22
username: "backup-user"
# Use either password or key_path for authentication
# password: "your-ssh-password"
key_path: "/home/user/.ssh/id_rsa"
# Optional: path to known_hosts file for host key verification
# known_hosts: "/home/user/.ssh/known_hosts"
# PostgreSQL connection settings (as seen from the production server)
postgres:
host: "localhost" # PostgreSQL host from prod server's perspective
port: 5432
database: "production_db"
username: "postgres"
password: "your-postgres-password"
# S3-compatible storage settings (Garage)
s3:
endpoint: "https://s3.garage.example.com"
access_key_id: "your-access-key"
secret_access_key: "your-secret-key"
bucket: "backups"
prefix: "postgres" # Optional: prefix for backup files
region: "garage" # Default: us-east-1
# Backup configuration
backup:
temp_dir: "/tmp" # Temporary directory on prod server
retention_count: 7 # Number of backups to keep
compression_level: 6 # Compression level (0-9, 0=none, 9=max)
# Schedule configuration (optional)
# Enable to run backups on a schedule
# schedule:
# enabled: true
# type: "daily" # Options: cron, interval, daily, weekly, monthly
# expression: "02:00" # Expression format depends on type
# run_on_start: false # Run backup immediately when scheduler starts
#
# # Examples for different schedule types:
# # Cron expression:
# # type: "cron"
# # expression: "0 2 * * *" # Daily at 2 AM
#
# # Fixed interval:
# # type: "interval"
# # expression: "6h" # Every 6 hours
#
# # Weekly:
# # type: "weekly"
# # expression: "Monday 02:00" # Every Monday at 2 AM
#
# # Monthly:
# # type: "monthly"
# # expression: "15 02:00" # 15th of each month at 2 AM
# Operation timeouts
timeouts:
ssh_connection: "30s" # SSH connection timeout
backup_operation: "2h" # pg_dump operation timeout
transfer: "1h" # File transfer timeout
s3_upload: "2h" # S3 upload timeout
# Restore configuration (optional)
restore:
enabled: false # Enable/disable restore functionality
# Optional: Control SSH usage for restore (defaults to true)
# use_ssh: false # Set to false for local restore without SSH
# Optional: Auto-install PostgreSQL client tools if missing (local restore only)
# auto_install: true # Automatically install pg_restore if not found
# Optional: SSH connection for restore target server (defaults to main SSH settings if not specified)
# Uncomment and configure if restoring to a different server than the backup source
# Note: Ignored if use_ssh is false
# ssh:
# host: "staging-server.example.com"
# port: 22
# username: "restore-user"
# password: "password" # Use either password or key_path
# key_path: "/home/user/.ssh/id_rsa"
# known_hosts: "/home/user/.ssh/known_hosts"
# Target PostgreSQL connection (defaults to source postgres settings if not specified)
target_host: "" # Target PostgreSQL host (defaults to postgres.host)
target_port: 0 # Target PostgreSQL port (defaults to postgres.port)
target_database: "" # Target database name (defaults to postgres.database)
target_username: "" # Target PostgreSQL username (defaults to postgres.username)
target_password: "" # Target PostgreSQL password (defaults to postgres.password)
drop_existing: false # Drop existing database before restore
force_disconnect: false # Force disconnect existing connections when dropping database
create_db: false # Create database if it doesn't exist
owner: "" # Database owner (optional, used when create_db is true)
jobs: 1 # Number of parallel jobs for restore (1-8)
# backup_key: "" # Specific backup key to restore (optional, uses latest if not specified)
# Schedule configuration (optional)
# Enable to run restore tests on a schedule (useful for disaster recovery validation)
# schedule:
# enabled: false
# type: "weekly"
# expression: "Sunday 03:00" # Weekly restore test on Sunday at 3 AM
# run_on_start: false
# Webhook notification settings (optional)
# Sends HTTP POST requests with JSON payload to the configured webhook URL
notification:
enabled: false # Enable/disable notifications
webhook_url: "https://webhook.example.com/notifications" # Webhook URL to send notifications
# Optional custom headers (e.g., for authentication)
headers:
Authorization: "Bearer your-token-here"
X-Custom-Header: "custom-value"
# Log configuration (optional)
# Controls where and how logs are written
log:
file_path: "" # Path to log file (empty = stdout)
max_size: 100 # Max size in MB before rotation
max_backups: 3 # Max number of old log files to keep
max_age: 30 # Max days to retain old log files
compress: true # Compress rotated log files
rotation_time: "daily" # Time-based rotation: "hourly", "daily", "weekly", or duration like "24h"
rotation_minute: 0 # Minute to rotate (0-59, for hourly/daily/weekly rotation)
# Cleanup configuration (optional)
# Schedule cleanup independently from backups
# cleanup:
# schedule:
# enabled: false
# type: "daily"
# expression: "04:00" # Daily cleanup at 4 AM
# run_on_start: false