From 4facb0674ab3f9e2deac6e92717b71cbd05f3c10 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Sat, 26 Nov 2022 15:03:38 +0100 Subject: [PATCH] /etc/plc.d/db dump-and-clean --- plc.d/db | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/plc.d/db b/plc.d/db index ccf9bf6..4d0ef8a 100755 --- a/plc.d/db +++ b/plc.d/db @@ -188,6 +188,12 @@ migrate) result "$MESSAGE" ;; +stop) + MESSAGE="Ignoring request to stop myplc databases" + dialog "$MESSAGE" + result "" + ;; + dump) MESSAGE=$"Dumping the databases in /var/lib/pgsql/backups" dialog "$MESSAGE" @@ -197,6 +203,23 @@ dump) result "$MESSAGE" ;; +clean-dump) + MESSAGE=$"Cleaning old database dumps" + dialog "$MESSAGE" + # clean_dump has a builtin default, so no problem + clean_dump $2 + result "$MESSAGE" + ;; + +dump-and-clean) + MESSAGE=$"dumping databases and cleaning old dumps" + dialog "$MESSAGE" + dump_planetlab_db + dump_drupal_db + clean_dump $2 + result "$MESSAGE" + ;; + checkpoint) MESSAGE=$"Checkpointing the databases" checkpoint_planetlab_db $2 @@ -209,22 +232,8 @@ restore) restore_drupal_db $3 ;; -clean-dump) - MESSAGE=$"Cleaning old database dumps" - dialog "$MESSAGE" - # clean_dump has a builtin default, so no problem - clean_dump $2 - result "$MESSAGE" - ;; - -stop) - MESSAGE="Ignoring request to stop myplc databases" - dialog "$MESSAGE" - result "" - ;; - *) - echo "Usage: $0 [start|migrate|dump|checkpoint|restore|clean-dump|stop]" + echo "Usage: $0 [start|migrate|stop|dump|clean-dump|dump-and-clean|checkpoint|restore]" exit 1 ;; esac -- 2.43.0