feat: CI/CD pipeline setup complete - Ansible playbooks updated, secrets configured, workflow ready
This commit is contained in:
23
deployment/stacks/postgresql/scripts/backup-entrypoint.sh
Executable file
23
deployment/stacks/postgresql/scripts/backup-entrypoint.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
echo "🔄 PostgreSQL Backup Service Starting..."
|
||||
echo "📅 Backup Schedule: ${BACKUP_SCHEDULE}"
|
||||
echo "🗑️ Retention: ${BACKUP_RETENTION_DAYS} days"
|
||||
|
||||
# Install cronie for scheduled backups
|
||||
apk add --no-cache dcron
|
||||
|
||||
# Create cron job
|
||||
echo "${BACKUP_SCHEDULE} /scripts/backup.sh >> /var/log/backup.log 2>&1" > /etc/crontabs/root
|
||||
|
||||
# Ensure backup directory exists
|
||||
mkdir -p /backups
|
||||
|
||||
# Run initial backup
|
||||
echo "🚀 Running initial backup..."
|
||||
/scripts/backup.sh
|
||||
|
||||
# Start cron in foreground
|
||||
echo "✅ Backup service ready - cron daemon starting"
|
||||
crond -f -l 2
|
||||
Reference in New Issue
Block a user