updated to working, mostly automated script
This commit is contained in:
parent
844fe85d6d
commit
e43b887413
@ -1,10 +1,36 @@
|
|||||||
#!/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/garrus/
|
###############################
|
||||||
|
### update local backup dir ###
|
||||||
|
###############################
|
||||||
|
|
||||||
sd rsync_backup --link-dest="/etc/ssh/" /etc/ssh/ ssh/
|
# first part is still kind of manual for now...
|
||||||
|
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
|
||||||
|
BACKUP_DIR_ROOT=$BACKUP_DIR/root/etc
|
||||||
|
rsync_backup --link-dest="/etc/ssh/" /etc/ssh/ $BACKUP_DIR_ROOT/ssh/
|
||||||
|
if [[ !(-d $BACKUP_DIR_ROOT/udev/rules.d) ]]; then
|
||||||
|
mkdir $BACKUP_DIR_ROOT/udev/rules.d
|
||||||
|
fi
|
||||||
|
if [[ !(/etc/udev/rules.d/69-hdparm.rules -ef $BACKUP_DIR_ROOT/udev/rules.d/69-hdparm.rules) ]]; then
|
||||||
|
ln /etc/udev/rules.d/69-hdparm.rules $BACKUP_DIR_ROOT/udev/rules.d/69-hdparm.rules
|
||||||
|
fi
|
||||||
|
|
||||||
|
#####################
|
||||||
|
### upload backup ###
|
||||||
|
#####################
|
||||||
|
|
||||||
|
echo $'upload of backup still manual for now.\nplease execute the following commands:'
|
||||||
|
echo 'su garrus'
|
||||||
|
echo 'sd rsync_backup $BACKUP_DIR/ /citadel/backup/garrus/'
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
su garrus
|
||||||
|
sd rsync_backup $BACKUP_DIR/ /citadel/backup/garrus/
|
||||||
|
Loading…
Reference in New Issue
Block a user