Fix backup-home service

This commit is contained in:
2024-03-05 22:15:31 +01:00
parent e2f45ccc42
commit 89362838dc
3 changed files with 39 additions and 27 deletions

View File

@@ -1,19 +0,0 @@
#!/usr/bin/env bash
export RESTIC_PASSWORD="gunter.home.2rjus.net"
export RESTIC_REPOSITORY="rest:http://10.69.12.52:8000/gunter.home.2rjus.net"
notify-send -e -t 3000 "Backup started" "Backup of /home/torjus started"
SECONDS=0
restic backup /home/torjus \
--exclude '/home/torjus/.cache' \
--exclude '/home/torjus/.local/share/Steam' \
--exclude '/home/torjus/git/nixpkgs'
retval=$?
if [ $retval -ne 0 ]; then
notify-send -u critical "Backup failed" "Backup of /home/torjus failed"
exit 1
fi
restic forget -d 7 -w 4 -m 6 --prune
notify-send -e -t 3000 "Backup completed" "Backup of /home/torjus completed in $SECONDS seconds."

View File

@@ -1,4 +1,4 @@
{ config, ... }: {
{ pkgs, config, ... }: {
home.file.".local/bin/hl-no-opacity" = {
source = ./hl-no-opacity.sh;
executable = true;
@@ -11,8 +11,4 @@
source = ./randomwp.sh;
executable = true;
};
home.file.".local/bin/backup-home" = {
source = ./backup-home.sh;
executable = true;
};
}