From dbaec48ea9c76b4a365b1c478fec20a846e7a838 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 16 May 2020 05:06:37 +0200 Subject: [PATCH 1/3] Clean mogodb backup and restore output Fix #87 --- scripts/backup | 2 +- scripts/restore | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/backup b/scripts/backup index 92585fb..77f61e3 100644 --- a/scripts/backup +++ b/scripts/backup @@ -60,7 +60,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= ynh_print_info --message="Backing up the MongoDB database..." -mongodump --db "$db_name" -o "./dump" +mongodump --db "$db_name" -o "./dump" >/dev/null #================================================= # SPECIFIC BACKUP diff --git a/scripts/restore b/scripts/restore index 445e21f..76e0350 100644 --- a/scripts/restore +++ b/scripts/restore @@ -103,7 +103,7 @@ ynh_print_info --message="Restoring the MongoDB database..." # Start mongodb systemctl enable $mongodb_servicename systemctl start $mongodb_servicename -mongorestore --db $db_name ./dump/$db_name +mongorestore --db $db_name ./dump/$db_name >/dev/null #================================================= # RESTORE SYSTEMD From 0b92e8c584ad5c8863dbc90a8da05a563dd5d0dc Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 16 May 2020 20:00:10 +0200 Subject: [PATCH 2/3] Reduce verbosity --- scripts/backup | 2 +- scripts/restore | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/backup b/scripts/backup index 77f61e3..154c3cf 100644 --- a/scripts/backup +++ b/scripts/backup @@ -60,7 +60,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= ynh_print_info --message="Backing up the MongoDB database..." -mongodump --db "$db_name" -o "./dump" >/dev/null +mongodump --db="$db_name" --out="./dump" --quiet #================================================= # SPECIFIC BACKUP diff --git a/scripts/restore b/scripts/restore index 76e0350..d9e4bd0 100644 --- a/scripts/restore +++ b/scripts/restore @@ -103,7 +103,7 @@ ynh_print_info --message="Restoring the MongoDB database..." # Start mongodb systemctl enable $mongodb_servicename systemctl start $mongodb_servicename -mongorestore --db $db_name ./dump/$db_name >/dev/null +mongorestore --db="$db_name" --archive="./dump/$db_name" --quiet #================================================= # RESTORE SYSTEMD From 8dc3ce9ab5243f3082f1118f6415520531e0ef4a Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 25 May 2020 23:30:24 +0200 Subject: [PATCH 3/3] fix restore --- scripts/backup | 2 +- scripts/restore | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/backup b/scripts/backup index 154c3cf..1f8315e 100644 --- a/scripts/backup +++ b/scripts/backup @@ -60,7 +60,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= ynh_print_info --message="Backing up the MongoDB database..." -mongodump --db="$db_name" --out="./dump" --quiet +mongodump --quiet --db="$db_name" --out="./dump" #================================================= # SPECIFIC BACKUP diff --git a/scripts/restore b/scripts/restore index d9e4bd0..45444ad 100644 --- a/scripts/restore +++ b/scripts/restore @@ -103,7 +103,7 @@ ynh_print_info --message="Restoring the MongoDB database..." # Start mongodb systemctl enable $mongodb_servicename systemctl start $mongodb_servicename -mongorestore --db="$db_name" --archive="./dump/$db_name" --quiet +mongorestore --quiet --db="$db_name" "./dump/$db_name" #================================================= # RESTORE SYSTEMD