enable hourly backups for flamesites
This commit is contained in:
parent
d66233763c
commit
172d73e80b
2 changed files with 38 additions and 1 deletions
|
|
@ -25,6 +25,10 @@ let
|
||||||
|
|
||||||
# actualbudget
|
# actualbudget
|
||||||
"${volumePath}/actualbudget"
|
"${volumePath}/actualbudget"
|
||||||
|
|
||||||
|
# flamesites
|
||||||
|
"${volumePath}/flamesites/swgalaxyproject"
|
||||||
|
"${volumePath}/flamesites/nnsbluegrass"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,37 @@
|
||||||
{inputs, ...}: {
|
{
|
||||||
|
pkgs,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
volumePath = "/overseer/services";
|
||||||
|
in {
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"d ${volumePath}/flamesites 0750 crow"
|
||||||
|
"d ${volumePath}/flamesites/swgalaxyproject 0750 crow"
|
||||||
|
"d ${volumePath}/flamesites/nnsbluegrass 0750 crow"
|
||||||
|
];
|
||||||
|
|
||||||
|
systemd.timers.flamesite-backup = {
|
||||||
|
enable = true;
|
||||||
|
wantedBy = ["timers.target"];
|
||||||
|
timerConfig = {
|
||||||
|
OnBootSec = "1hr";
|
||||||
|
OnUnitActiveSec = "1hr";
|
||||||
|
Unit = "flamesite-backup.service";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.flamesite-backup = {
|
||||||
|
script = ''
|
||||||
|
${pkgs.podman}/bin/podman exec swgal_db_1 sh -c 'exec mysqldump --no-tablespaces -usgr_user -psgr_pass sgr_db' > ${volumePath}/flamesites/swgalaxyproject/db.sql
|
||||||
|
${pkgs.podman}/bin/podman exec nssbluegrass_db_1 sh -c 'exec mysqldump --no-tablespaces -unns_user -pnns_pass nns_db' > ${volumePath}/flamesites/nnsbluegrass/db.sql
|
||||||
|
'';
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
User = "crow";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
recommendedProxySettings = true;
|
recommendedProxySettings = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue