sync/scripts/backup_shepard.sh

25 lines
689 B
Bash
Raw Normal View History

2023-05-06 05:44:49 +02:00
#!/usr/bin/env bash
set -euo pipefail
source /sync/home_external/.bash_aliases
shopt -s expand_aliases # make aliases work
###############################
### update local backup dir ###
###############################
BACKUP_DIR=/sync/backup
BACKUP_DIR_HOME=$BACKUP_DIR/home
if [[ !($HOME/.bash_aliases_local -ef $BACKUP_DIR_HOME/.bash_aliases_local) ]]; then
ln $HOME/.bash_aliases_local $BACKUP_DIR_HOME/.bash_aliases_local
fi
rsync_backup --link-dest="$HOME/.ssh/" $HOME/.ssh/ $BACKUP_DIR_HOME/.ssh/
#####################
### upload backup ###
#####################
sd rsync_backup -e "ssh -i /home/fabian/.ssh/id_ed25519" $BACKUP_DIR/ fabian@garrus:/citadel/backup/shepard/