sync/scripts/backup_shepard.sh

28 lines
659 B
Bash
Raw Normal View History

2023-05-06 05:44:49 +02:00
#!/usr/bin/env bash
set -euo pipefail
2024-03-17 17:58:00 +01:00
source /sync/scripts/backup_resources.sh
# FSFIXME expand_aliases still needed?
2023-05-06 05:44:49 +02:00
shopt -s expand_aliases # make aliases work
###############################
### update local backup dir ###
###############################
BACKUP_DIR=/sync/backup
2024-03-17 17:58:00 +01:00
ensureDirectory $BACKUP_DIR
2023-05-06 05:44:49 +02:00
BACKUP_DIR_HOME=$BACKUP_DIR/home
2024-03-17 17:58:00 +01:00
ensureDirectory $BACKUP_DIR_HOME
2023-05-06 05:44:49 +02:00
2024-03-17 17:58:00 +01:00
backupDirectory $HOME/.ssh/ $BACKUP_DIR_HOME/.ssh/
2023-05-06 05:44:49 +02:00
#####################
### upload backup ###
#####################
2024-03-17 17:58:00 +01:00
if [[ "$1" == "--noupload" ]]; then
exit 0;
fi
2023-05-06 05:44:49 +02:00
sd rsync_backup -e "ssh -i /home/fabian/.ssh/id_ed25519" $BACKUP_DIR/ fabian@garrus:/citadel/backup/shepard/