Created
December 15, 2022 09:48
-
-
Save joshbrooks/f04b0ccc0564b9864490c690db73b4f5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SERVER=partisipa-staging.catalpa.build | |
DATABASE=partisipa_db | |
ssh_server := ssh root@${SERVER} | |
fetchdatabase : | |
$(ssh_server) rm -rf /tmp/pg_data_$(shell date -I)_$(shell hostname) | |
$(ssh_server) pg_dump --compress=0 --format=directory postgresql:///$(DATABASE) -f /tmp/pg_data_$(shell date -I)_$(shell hostname) | |
rsync --archive --compress --del root@${SERVER}:/tmp/pg_data_$(shell date -I)_$(shell hostname)/ ./source/ || true | |
$(ssh_server) rm -rf /tmp/pg_data_$(shell date -I)_$(shell hostname) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment