nixos/home-manager/modules/scripts/sync-backup

14 lines
290 B
Bash
Executable File

#!/usr/bin/env sh
disk="$1"
sudo cryptsetup luksOpen "$disk" crypt
sudo mount /dev/mapper/crypt "$HOME/Documents/drive"
rsync -ahAXv --delete /home/crony/.local/backup/ /home/crony/Documents/drive/backup
sudo umount "$HOME/Documents/drive"
sudo cryptsetup luksClose /dev/mapper/crypt