2023-05-05 18:21:28 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
2023-05-06 04:52:14 +02:00
|
|
|
source /sync/home_external/.bash_aliases
|
2023-05-05 18:21:28 +02:00
|
|
|
shopt -s expand_aliases # make aliases work
|
|
|
|
|
2023-05-06 04:54:15 +02:00
|
|
|
|
2023-05-06 04:52:14 +02:00
|
|
|
###############################
|
|
|
|
### update local backup dir ###
|
|
|
|
###############################
|
2023-05-05 18:21:28 +02:00
|
|
|
|
2023-05-06 04:52:14 +02:00
|
|
|
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
|
2023-05-06 05:44:19 +02:00
|
|
|
|
2023-05-06 04:52:14 +02:00
|
|
|
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
|
|
|
|
|
2023-05-06 04:54:15 +02:00
|
|
|
|
2023-05-06 04:52:14 +02:00
|
|
|
#####################
|
|
|
|
### upload backup ###
|
|
|
|
#####################
|
|
|
|
|
2023-09-24 15:11:14 +02:00
|
|
|
echo 'upload of backup still manual for now.\nplease execute the following commands:'
|
2023-05-06 04:52:14 +02:00
|
|
|
echo 'su garrus'
|
2023-09-24 15:11:14 +02:00
|
|
|
echo "sd rsync_backup $BACKUP_DIR/ /citadel/backup/garrus/"
|
2023-05-06 04:52:14 +02:00
|
|
|
exit 0
|
|
|
|
|
|
|
|
su garrus
|
|
|
|
sd rsync_backup $BACKUP_DIR/ /citadel/backup/garrus/
|