fin backups
This commit is contained in:
@@ -3,7 +3,15 @@
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
/*
|
||||
to restore db make sure it exists with rebuild or command below
|
||||
then use zstd command to decompress and restore in one go
|
||||
|
||||
mysql -u root -p -e "CREATE DATABASE IF NOT EXISTS minecraft_recpro_db;"
|
||||
zstd -dc <path_to_backup> | mysql -u root -p minecraft_recpro_db
|
||||
*/
|
||||
let
|
||||
service = "minecraft_recpro";
|
||||
cfg = config.gameservers.${service};
|
||||
sec = config.sops.secrets;
|
||||
@@ -141,7 +149,14 @@ in {
|
||||
#paths = lib.flatten (lib.attrValues (lib.mapAttrs (_: srv: [srv.data_dir]) servers));
|
||||
paths = lib.flatten (
|
||||
lib.attrValues (
|
||||
lib.mapAttrs (_: srv: [srv.data_dir] ++ (if builtins.hasAttr "db_dump_dir" srv then [srv.db_dump_dir] else [])) servers
|
||||
lib.mapAttrs (_: srv:
|
||||
[srv.data_dir]
|
||||
++ (
|
||||
if builtins.hasAttr "db_dump_dir" srv
|
||||
then [srv.db_dump_dir]
|
||||
else []
|
||||
))
|
||||
servers
|
||||
)
|
||||
);
|
||||
compression = "auto,zstd";
|
||||
|
||||
Reference in New Issue
Block a user