backups
creating a crpytdrive
kind of optional, since the backup itself is encrypted already - but i like to just encrypt my external drives, no matter what i want to do with it later. maybe you just want to add something else, for some reason?
cryptsetup…
xhost +local: # fix cannot open display
sudo gparted
sudo cryptsetup luksFormat /dev/sdX
sudo cryptsetup open /dev/sdb crypt
mkfs -t ext4 /dev/mapper/crypt
sudo mkdir /mnt/backup/
sudo mount /dev/mapper/crypt /mnt/backup/
restic init
sudo mkdir /etc/restic/
/etc/restic/env
export RESTIC_REPOSITORY=/mnt/backup/
export RESTIC_PASSWORD_COMMAND="pass servers_backupplatte_restic"
source /env/restic/env
cd /mnt/backup
sudo --preserve-env restic init
bash: was backuppen
set -e
`set -x` enable xtrace - print commands
`set -e` exit on errors
`set -u` error on undefined variables
`set -o pipefail` error when piped commands fail
`set -o nounset` fail when accessing unset variables