aboutsummaryrefslogtreecommitdiffstats
path: root/extra
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2022-11-23 16:00:13 -0800
committerBryan Newbold <bnewbold@robocracy.org>2022-11-23 16:00:13 -0800
commit82bb8f0c6e73e2a7f282c6372b6ae8716be37851 (patch)
tree11622e8da7bd6445a52643202f8cfe115dce5ecd /extra
parent869df8572f1676b86930e5e2bca440fcaa053e31 (diff)
downloadfatcat-82bb8f0c6e73e2a7f282c6372b6ae8716be37851.tar.gz
fatcat-82bb8f0c6e73e2a7f282c6372b6ae8716be37851.zip
dumps: private database dump commands
Diffstat (limited to 'extra')
-rw-r--r--extra/sql_dumps/Makefile18
1 files changed, 18 insertions, 0 deletions
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