/etc/plc.d/db dump-and-clean
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Sat, 26 Nov 2022 14:03:38 +0000 (15:03 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Sat, 26 Nov 2022 14:03:38 +0000 (15:03 +0100)
plc.d/db

index ccf9bf6..4d0ef8a 100755 (executable)
--- 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