this finally works phew
This commit is contained in:
parent
93307a7026
commit
5f92f6fae1
1 changed files with 5 additions and 5 deletions
10
backup.nix
10
backup.nix
|
@ -8,11 +8,11 @@ let
|
||||||
#stop forgejo
|
#stop forgejo
|
||||||
systemctl stop forgejo.service
|
systemctl stop forgejo.service
|
||||||
# MySQL-Backup
|
# MySQL-Backup
|
||||||
MYSQL_OPTION_FILE="/etc/nixos/dbauth.cnf"
|
|
||||||
MYSQL_DATABASE="forgejodb"
|
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
|
# 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)"
|
export BACKUP_NAME="forgejo-$(date +%Y-%m-%d)"
|
||||||
|
|
||||||
# Add everything to be backed up
|
# Add everything to be backed up
|
||||||
|
@ -39,7 +39,7 @@ let
|
||||||
systemd.services.borg-backup = {
|
systemd.services.borg-backup = {
|
||||||
description = "Borg Backup for Forgejo and MySQL";
|
description = "Borg Backup for Forgejo and MySQL";
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${forgejo-borgbackup}";
|
ExecStart = "${forgejo-borgbackup}/bin/forgejo-borgbackup";
|
||||||
User = "root";
|
User = "root";
|
||||||
};
|
};
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
@ -53,4 +53,4 @@ let
|
||||||
Persistent = true;
|
Persistent = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue