From 82bb8f0c6e73e2a7f282c6372b6ae8716be37851 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 23 Nov 2022 16:00:13 -0800 Subject: dumps: private database dump commands --- extra/sql_dumps/Makefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'extra/sql_dumps') diff --git a/extra/sql_dumps/Makefile b/extra/sql_dumps/Makefile index a653d422..a644e2cc 100644 --- a/extra/sql_dumps/Makefile +++ b/extra/sql_dumps/Makefile @@ -91,3 +91,21 @@ $(DATADIR)/.PUBLIC_DB_UPLOADED: $(DATADIR)/.PUBLIC_DB_DUMP .PHONY: upload-public-database-snapshot upload-public-database-snapshot: create_datadir public-database-snapshot $(DATADIR)/.PUBLIC_DB_UPLOADED ## Upload metadata snapshot to archive.org @echo + +$(DATADIR)/.PRIVATE_DB_DUMP: + sudo -u postgres pg_dump --verbose --format=custom fatcat_prod > $(DATADIR)/fatcat_private_dbdump_${DATESLUG}.pgdump.wip + mv $(DATADIR)/fatcat_private_dbdump_${DATESLUG}.pgdump.wip $(DATADIR)/fatcat_private_dbdump_${DATESLUG}.pgdump + touch $@ + +.PHONY: private-database-snapshot +private-database-snapshot: create_datadir $(DATADIR)/.PRIVATE_DB_DUMP ## Create SQL database snapshot which can be shared privately + @echo + +$(DATADIR)/.PRIVATE_DB_UPLOADED: $(DATADIR)/.PRIVATE_DB_DUMP + ia upload --checksum fatcat_sqldump_private_$(TODAY) ia_sqldump_item_readme.md --remote-name=README.md -m collection:webgroup-internal-backups -m mediatype:data -m creator:"Internet Archive Web Group" -m date:$(TODAY) -m title:"Fatcat Private Database Snapshot ($(TODAY))" + ia upload --checksum fatcat_sqldump_private_$(TODAY) $(DATADIR)/fatcat_private_dbdump_*.pgdump + touch $@ + +.PHONY: upload-private-database-snapshot +upload-private-database-snapshot: create_datadir private-database-snapshot $(DATADIR)/.PRIVATE_DB_UPLOADED ## Upload metadata snapshot to archive.org + @echo -- cgit v1.2.3