Compare commits
2 Commits
3337e168c7
...
1acf2a2305
Author | SHA1 | Date | |
---|---|---|---|
1acf2a2305 | |||
16de7c94da |
@ -1,10 +1,39 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
source /sync/home_external/.bash_aliases
|
||||||
shopt -s expand_aliases # make aliases work
|
shopt -s expand_aliases # make aliases work
|
||||||
REL_HOME=$HOME
|
|
||||||
source $REL_HOME/.bash_aliases
|
|
||||||
|
|
||||||
sd rsync_backup -e "ssh -i $REL_HOME/.ssh/id_ed25519" ./ fabian@garrus:/citadel/backup/edi/
|
|
||||||
|
###############################
|
||||||
|
### 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/
|
||||||
|
|
||||||
|
BACKUP_DIR_ROOT=$BACKUP_DIR/root/etc
|
||||||
|
rsync_backup --link-dest="/etc/ddclient/" /etc/ddclient/ $BACKUP_DIR_ROOT/ddclient/
|
||||||
|
rsync_backup --link-dest="/etc/letsencrypt/" /etc/letsencrypt/ $BACKUP_DIR_ROOT/letsencrypt/
|
||||||
|
rsync_backup --link-dest="/etc/nginx/" /etc/nginx/ $BACKUP_DIR_ROOT/nginx/
|
||||||
|
rsync_backup --link-dest="/etc/ssh/" /etc/ssh/ $BACKUP_DIR_ROOT/ssh/
|
||||||
|
rsync_backup --link-dest="/etc/wireguard/" /etc/wireguard/ $BACKUP_DIR_ROOT/wireguard/
|
||||||
|
if [[ !(/etc/ddclient.conf -ef $BACKUP_DIR_ROOT/ddclient.conf) ]]; then
|
||||||
|
ln /etc/ddclient.conf $BACKUP_DIR_ROOT/ddclient.conf
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
#####################
|
||||||
|
### upload backup ###
|
||||||
|
#####################
|
||||||
|
|
||||||
|
rsync_backup $BACKUP_DIR/ fabian@garrus:/citadel/backup/shepard/
|
||||||
|
|
||||||
|
sd rsync_backup -e "ssh -i /home/edi/.ssh/id_ed25519" /sync/backup/ fabian@garrus:/citadel/backup/edi/
|
||||||
|
sd rsync_backup -e "ssh -i /home/edi/.ssh/id_ed25519" /home/edi/docker/ fabian@garrus:/citadel/backup/edi/home/docker/
|
||||||
|
|
||||||
sd rsync_backup --link-dest="/etc/ssh/" /etc/ssh/ ssh/
|
sd rsync_backup --link-dest="/etc/ssh/" /etc/ssh/ ssh/
|
||||||
|
@ -9,12 +9,12 @@ shopt -s expand_aliases # make aliases work
|
|||||||
### update local backup dir ###
|
### update local backup dir ###
|
||||||
###############################
|
###############################
|
||||||
|
|
||||||
# first part is still kind of manual for now...
|
|
||||||
BACKUP_DIR=/sync/backup
|
BACKUP_DIR=/sync/backup
|
||||||
BACKUP_DIR_HOME=$BACKUP_DIR/home
|
BACKUP_DIR_HOME=$BACKUP_DIR/home
|
||||||
if [[ !($HOME/.bash_aliases_local -ef $BACKUP_DIR_HOME/.bash_aliases_local) ]]; then
|
if [[ !($HOME/.bash_aliases_local -ef $BACKUP_DIR_HOME/.bash_aliases_local) ]]; then
|
||||||
ln $HOME/.bash_aliases_local $BACKUP_DIR_HOME/.bash_aliases_local
|
ln $HOME/.bash_aliases_local $BACKUP_DIR_HOME/.bash_aliases_local
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BACKUP_DIR_ROOT=$BACKUP_DIR/root/etc
|
BACKUP_DIR_ROOT=$BACKUP_DIR/root/etc
|
||||||
rsync_backup --link-dest="/etc/ssh/" /etc/ssh/ $BACKUP_DIR_ROOT/ssh/
|
rsync_backup --link-dest="/etc/ssh/" /etc/ssh/ $BACKUP_DIR_ROOT/ssh/
|
||||||
if [[ !(-d $BACKUP_DIR_ROOT/udev/rules.d) ]]; then
|
if [[ !(-d $BACKUP_DIR_ROOT/udev/rules.d) ]]; then
|
||||||
|
24
scripts/backup_shepard.sh
Normal file → Executable file
24
scripts/backup_shepard.sh
Normal file → Executable file
@ -0,0 +1,24 @@
|
|||||||
|
#!/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/
|
Loading…
Reference in New Issue
Block a user