Merge pull request #47 from xcompass/custom-archive-timeout
Add environment var to allow customize archive timeout
This commit is contained in:
		
						commit
						74af02ead1
					
				| @ -3,6 +3,7 @@ | |||||||
| # if wal backup is not enabled, use minimal wal logging to reduce disk space | # if wal backup is not enabled, use minimal wal logging to reduce disk space | ||||||
| : ${WAL_LEVEL:=minimal} | : ${WAL_LEVEL:=minimal} | ||||||
| : ${ARCHIVE_MODE:=off} | : ${ARCHIVE_MODE:=off} | ||||||
|  | : ${ARCHIVE_TIMEOUT:=60} | ||||||
| # PGDATA is defined in upstream postgres dockerfile | # PGDATA is defined in upstream postgres dockerfile | ||||||
| 
 | 
 | ||||||
| function update_conf () { | function update_conf () { | ||||||
|  | |||||||
| @ -4,7 +4,7 @@ | |||||||
| echo "wal_level = $WAL_LEVEL" >> $PGDATA/postgresql.conf | echo "wal_level = $WAL_LEVEL" >> $PGDATA/postgresql.conf | ||||||
| echo "archive_mode = $ARCHIVE_MODE" >> $PGDATA/postgresql.conf | echo "archive_mode = $ARCHIVE_MODE" >> $PGDATA/postgresql.conf | ||||||
| echo "archive_command = 'envdir /etc/wal-e.d/env /usr/local/bin/wal-e wal-push %p'" >> $PGDATA/postgresql.conf | echo "archive_command = 'envdir /etc/wal-e.d/env /usr/local/bin/wal-e wal-push %p'" >> $PGDATA/postgresql.conf | ||||||
| echo "archive_timeout = 60" >> $PGDATA/postgresql.conf | echo "archive_timeout = $ARCHIVE_TIMEOUT" >> $PGDATA/postgresql.conf | ||||||
| 
 | 
 | ||||||
| # no cron in the image, use systemd timer on host instead | # no cron in the image, use systemd timer on host instead | ||||||
| #su - postgres -c "crontab -l | { cat; echo \"0 3 * * * /usr/bin/envdir /etc/wal-e.d/env /usr/local/bin/wal-e backup-push /var/lib/postgresql/data\"; } | crontab -" | #su - postgres -c "crontab -l | { cat; echo \"0 3 * * * /usr/bin/envdir /etc/wal-e.d/env /usr/local/bin/wal-e backup-push /var/lib/postgresql/data\"; } | crontab -" | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Yi EungJun
						Yi EungJun