File tree Expand file tree Collapse file tree
charts/database/templates Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4545 exec :
4646 command :
4747 - is_running
48+ lifecycle :
49+ preStop :
50+ exec :
51+ commmand :
52+ - gosu
53+ - postgres
54+ - do_backup
4855 initialDelaySeconds : 30
4956 timeoutSeconds : 1
5057 volumeMounts :
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
33export BACKUP_FREQUENCY=${BACKUP_FREQUENCY:- 4h}
4- export BACKUPS_TO_RETAIN=${BACKUPS_TO_RETAIN:- 5}
54
65while true ; do
76 sleep " $BACKUP_FREQUENCY "
8- echo " Performing a base backup..."
9- if [[ -f " $PGDATA /recovery.conf" ]] ; then
10- echo " Database is currently recovering from a backup. Will try again next loop..."
11- else
12- # perform a backup
13- envdir " $WALE_ENVDIR " wal-e backup-push " $PGDATA "
14- # only retain the latest BACKUPS_TO_RETAIN backups
15- envdir " $WALE_ENVDIR " wal-e delete --confirm retain " $BACKUPS_TO_RETAIN "
16- echo " Backup has been completed."
17- fi
7+ do_backup
188done
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ export BACKUPS_TO_RETAIN=${BACKUPS_TO_RETAIN:- 5}
4+
5+ echo " Performing a base backup..."
6+ if [[ -f " $PGDATA /recovery.conf" ]] ; then
7+ echo " Database is currently recovering from a backup. Aborting"
8+ else
9+ # perform a backup
10+ envdir " $WALE_ENVDIR " wal-e backup-push " $PGDATA "
11+ # only retain the latest BACKUPS_TO_RETAIN backups
12+ envdir " $WALE_ENVDIR " wal-e delete --confirm retain " $BACKUPS_TO_RETAIN "
13+ echo " Backup has been completed."
14+ fi
You can’t perform that action at this time.
0 commit comments