pg_archivecleanup
utility: 'pg_archivecleanup /path/to/archive %r'
. Ensure the command is tested and properly secured. The command should only remove WAL files that are older than the current recovery point. Always include proper error handling in your cleanup scripts.'/usr/local/bin/notify-recovery-complete.sh'
. Ensure the command is idempotent (safe to run multiple times) and has proper error handling. Test thoroughly as command failures may affect server startup. Keep commands simple and fast to execute.'cp /path/to/archive/%f %p'
. For cloud storage: 'aws s3 cp s3://your-bucket/wal/%f %p'
. The command must return exit code 0 on success, non-zero on failure. Include retry logic for unreliable storage. Test thoroughly and monitor for failures during recovery operations.Start your journey toward a healthier PostgreSQL with pghealth.
You can explore all features immediately with a free trial β no installation required.
π Start Free Trial