init nextcloud backup
This commit is contained in:
parent
2d8b2e985a
commit
dda65cd17e
|
@ -8,6 +8,27 @@ in
|
|||
environment.systemPackages = [
|
||||
nextcloud
|
||||
];
|
||||
systemd.timers."nextcloud-backup" = {
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
# OnBootSec = "5m";
|
||||
# OnUnitActiveSec = "5m";
|
||||
OnCalendar="*-*-* 2:00:00";
|
||||
Unit = "nextcloud-backup.service";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services."nextcloud-backup" = {
|
||||
script = ''
|
||||
set -eu
|
||||
${pkgs.postgresql}/bin/pg_dump "nextcloud" -f /tmp/dump.sql
|
||||
'';
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = "postgres";
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
nginx.virtualHosts = {
|
||||
${domain} = {
|
||||
|
|
Loading…
Reference in a new issue