summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.envrcbin916 -> 979 bytes
-rw-r--r--Makefile6
-rw-r--r--dumps/.backup3
-rwxr-xr-xdumps/backup-dbs.sh6
-rw-r--r--dumps/backup/.gitignore1
5 files changed, 15 insertions, 1 deletions
diff --git a/.envrc b/.envrc
index ad1a4b9..c742369 100644
--- a/.envrc
+++ b/.envrc
Binary files differ
diff --git a/Makefile b/Makefile
index eb1d4ce..c71f563 100644
--- a/Makefile
+++ b/Makefile
@@ -21,8 +21,12 @@ lineups: FORCE
checks: paid teams lineups
+backups: FORCE
+ ./dumps/backup-dbs.sh
+ s3cmd -c dumps/.s3config --exclude="*/*" sync dumps/backup/ ${LIGA_S3_BACKUP_BUCKET}
+
dumps: FORCE
- s3cmd -c dumps/.s3config sync ${LIGA_S3_BUCKET} dumps/sync/
+ s3cmd -c dumps/.s3config --exclude="*/*" sync ${LIGA_S3_BUCKET} dumps/sync/
./dumps/load-dumps.sh
butler: FORCE
diff --git a/dumps/.backup b/dumps/.backup
new file mode 100644
index 0000000..268874a
--- /dev/null
+++ b/dumps/.backup
@@ -0,0 +1,3 @@
+dmp202223_b0
+dmp202223_b1
+dmp202223_b2
diff --git a/dumps/backup-dbs.sh b/dumps/backup-dbs.sh
new file mode 100755
index 0000000..29e6367
--- /dev/null
+++ b/dumps/backup-dbs.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+cd $(dirname $0)
+grep -v '^#' .backup | while read DB
+do
+ mysqldump --column-statistics=0 ${LIGA_MYSQL_CONNECTION_OPTS} $DB > backup/$DB.sql
+done
diff --git a/dumps/backup/.gitignore b/dumps/backup/.gitignore
new file mode 100644
index 0000000..d1b811b
--- /dev/null
+++ b/dumps/backup/.gitignore
@@ -0,0 +1 @@
+*.sql