From 8dc038735f2a5297639bb2b766e8a96ab34f93be Mon Sep 17 00:00:00 2001 From: ivanchainik Date: Wed, 31 Mar 2021 13:05:43 +0300 Subject: [PATCH 1/5] Add script for backup --- backup.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 backup.sh diff --git a/backup.sh b/backup.sh new file mode 100755 index 0000000..6ddf141 --- /dev/null +++ b/backup.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +mysqldump=/usr/bin/mysqldump +mysql_user=root +mysql_password=root + +now=$(date +"%d_%m_%Y") + +$mysqldump --user=$mysql_user --password=$mysql_password --databases lmnad_db | gzip > backup_$now.sql.gz + +exit + +docker cp lmnad_mysql_dev:backup_$now.sql.gz /home/ivan/lmnad-master/backup + +docker exec -ti lmnad_mysql_dev rm backup_$now.sql.gz From dc0e81fdcc90f0997f000743532927f7c5b191fa Mon Sep 17 00:00:00 2001 From: ivanchainik Date: Wed, 31 Mar 2021 13:28:59 +0300 Subject: [PATCH 2/5] Change script for backup --- backup.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/backup.sh b/backup.sh index 6ddf141..3248188 100755 --- a/backup.sh +++ b/backup.sh @@ -6,10 +6,5 @@ mysql_password=root now=$(date +"%d_%m_%Y") -$mysqldump --user=$mysql_user --password=$mysql_password --databases lmnad_db | gzip > backup_$now.sql.gz +docker exec -i lmnad_mysql_dev $mysqldump --user=$mysql_user --password=$mysql_password --databases lmnad_db | gzip > backup/backup_$now.sql.gz -exit - -docker cp lmnad_mysql_dev:backup_$now.sql.gz /home/ivan/lmnad-master/backup - -docker exec -ti lmnad_mysql_dev rm backup_$now.sql.gz From 41c925e8f3637628114f2a3c2878c146a5d3cab1 Mon Sep 17 00:00:00 2001 From: ivanchainik <46136978+ivanchainik@users.noreply.github.com> Date: Tue, 20 Apr 2021 11:07:11 +0300 Subject: [PATCH 3/5] Update README.md --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a5a9eba..229506a 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,14 @@ Run migration manually or restore DB dump If you need data from site LMNAD locally (for testing and development goals), send request for getting data to arybin93@email.com +###Perform DB backup +1. Go to the project directory + +2. Run bash-script +''' +./backup.sh +''' + ### Restore DB backup 1. Unzip ``` @@ -123,4 +131,4 @@ According to [article](https://miki725.com/docker/crypto/2017/01/29/docker+nginx ```bash docker run -t --rm -v lmnad_certs:/etc/letsencrypt -v lmnad_certs_data:/data/letsencrypt deliverous/certbot renew --webroot --webroot-path=/data/letsencrypt docker-compose kill -s HUP nginx -``` \ No newline at end of file +``` From 58c54b88ee70983dee34b1b1c13124f0a5dbcce1 Mon Sep 17 00:00:00 2001 From: ivanchainik <46136978+ivanchainik@users.noreply.github.com> Date: Tue, 20 Apr 2021 11:07:54 +0300 Subject: [PATCH 4/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 229506a..6542e49 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ Run migration manually or restore DB dump If you need data from site LMNAD locally (for testing and development goals), send request for getting data to arybin93@email.com -###Perform DB backup +### Perform DB backup 1. Go to the project directory 2. Run bash-script From e89a30e6cd23caf06932732eb450c9bca6886867 Mon Sep 17 00:00:00 2001 From: ivanchainik <46136978+ivanchainik@users.noreply.github.com> Date: Tue, 20 Apr 2021 11:09:08 +0300 Subject: [PATCH 5/5] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6542e49..ffc514b 100644 --- a/README.md +++ b/README.md @@ -87,9 +87,9 @@ send request for getting data to arybin93@email.com 1. Go to the project directory 2. Run bash-script -''' -./backup.sh -''' +``` + ./backup.sh +``` ### Restore DB backup 1. Unzip