Pullable database stream dump SSH endpoints for postgresql/mysql #257
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
After the bicep incident, we are not able to store another copy of the database due to limited storage space on the VM. We should create SSH endpoints with restricted commands that only lets the requester receive a streamed database dump through the tunnel. That way, principal can still receive database dumps without us ever storing it on the disk
I assume you mean something like principal running
ssh psql@bicep "pg_dump dbnavn | gzip" > bicep_pgdump.sql.gzin the backup script?For anyone implementing; "SSH endpoints with restricted commands" can look like this
No, this was explicitly not what I meant. What I meant was to have the connection pipe the output of
pg_dumpthrough the SSH socket directly, without storing it to disk first (keyword here is stream), so that we wouldn't run into storage issues with the limited space we have on the current bicep instance.However, after I played around with it, I realized that the backup files takes much less storage than I had feared, so this issue is no longer relevant :)
That's what he wrote, principal runs
ssh psql@bicep pg_dump dbnavn | gzipwhich would then output the streamed gzip-compressed dump to stdout, which is then redirected on principal tobicep_pgdump.sql.gz