#!/usr/bin/env bash set -euo pipefail source /sync/scripts/backup_resources.sh # FSFIXME expand_aliases still needed? shopt -s expand_aliases # make aliases work ############################### ### update local backup dir ### ############################### BACKUP_DIR=/sync/backup ensureDirectory $BACKUP_DIR BACKUP_DIR_HOME=$BACKUP_DIR/home ensureDirectory $BACKUP_DIR_HOME BACKUP_DIR_ROOT=$BACKUP_DIR/root/etc ensureRootDirectory $BACKUP_DIR_ROOT backupRootDirectory /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 backupRootDirectory /etc/ssh/ $BACKUP_DIR_ROOT/ssh/ ##################### ### 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/