this finally works phew
This commit is contained in:
parent
f8f19d7d52
commit
0b32b3c8b2
1 changed files with 5 additions and 5 deletions
10
backup.nix
10
backup.nix
|
@ -8,11 +8,11 @@ let
|
|||
#stop forgejo
|
||||
systemctl stop forgejo.service
|
||||
# MySQL-Backup
|
||||
MYSQL_OPTION_FILE="/etc/nixos/dbauth.cnf"
|
||||
MYSQL_DATABASE="forgejodb"
|
||||
mysqldump --defaults-file="${MYSQL_OPTION_FILE}" $MYSQL_DATABASE > /borgbackupcache/forgejobackup.sql
|
||||
${pkgs.mariadb}/bin/mysqldump -u root ''${MYSQL_DATABASE} > /borgbackupcache/forgejobackup.sql
|
||||
# BorgBackup
|
||||
export BORG_REPO="ssh://backup@cloud.shibe.pro://mnt/onedrive/Backups/borg"
|
||||
export BORG_PASSCOMMAND="cat /etc/nixos/borgpassword"
|
||||
export BORG_REPO="backup@cloud.shibe.pro:/mnt/onedrive/Backups/borg/forgejo"
|
||||
export BACKUP_NAME="forgejo-$(date +%Y-%m-%d)"
|
||||
|
||||
# Add everything to be backed up
|
||||
|
@ -39,7 +39,7 @@ let
|
|||
systemd.services.borg-backup = {
|
||||
description = "Borg Backup for Forgejo and MySQL";
|
||||
serviceConfig = {
|
||||
ExecStart = "${forgejo-borgbackup}";
|
||||
ExecStart = "${forgejo-borgbackup}/bin/forgejo-borgbackup";
|
||||
User = "root";
|
||||
};
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
@ -53,4 +53,4 @@ let
|
|||
Persistent = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue