From 46e9aea2dd838d97f90517e7d6dafaaf9b34d02a Mon Sep 17 00:00:00 2001 From: fabian Date: Sun, 17 Mar 2024 14:14:34 +0100 Subject: [PATCH] fix: make functions known before usage --- scripts/backup_edi.sh | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/scripts/backup_edi.sh b/scripts/backup_edi.sh index d9d1291..9d422e0 100755 --- a/scripts/backup_edi.sh +++ b/scripts/backup_edi.sh @@ -5,28 +5,6 @@ source /sync/home_external/.bash_aliases 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 -backupDirectory $HOME/.ssh/ $BACKUP_DIR_HOME/.ssh/ - -BACKUP_DIR_ROOT=$BACKUP_DIR/root/etc -ensureRootDirectory $BACKUP_DIR_ROOT -sd rsync_backup /etc/hosts $BACKUP_DIR_ROOT/ -sd rsync_backup /etc/ddclient.conf $BACKUP_DIR_ROOT/ -backupRootDirectory /etc/ddclient/ $BACKUP_DIR_ROOT/ddclient/ -backupRootDirectory /etc/letsencrypt/ $BACKUP_DIR_ROOT/letsencrypt/ -backupRootDirectory /etc/nginx/ $BACKUP_DIR_ROOT/nginx/ -backupRootDirectory /etc/ssh/ $BACKUP_DIR_ROOT/ssh/ -backupRootDirectory /etc/wireguard/ $BACKUP_DIR_ROOT/wireguard/ -backupRootDirectory /etc/docker/daemon.json $BACKUP_DIR_ROOT/docker/ - - backupRootDirectory() { ensureRootDirectory $2 sd rsync_backup $1 $2 @@ -51,6 +29,27 @@ ensureDirectory() { fi } +############################### +### update local backup dir ### +############################### + +BACKUP_DIR=/sync/backup +ensureDirectory $BACKUP_DIR +BACKUP_DIR_HOME=$BACKUP_DIR/home +ensureDirectory $BACKUP_DIR_HOME +backupDirectory $HOME/.ssh/ $BACKUP_DIR_HOME/.ssh/ + +BACKUP_DIR_ROOT=$BACKUP_DIR/root/etc +ensureRootDirectory $BACKUP_DIR_ROOT +sd rsync_backup /etc/hosts $BACKUP_DIR_ROOT/ +sd rsync_backup /etc/ddclient.conf $BACKUP_DIR_ROOT/ +backupRootDirectory /etc/ddclient/ $BACKUP_DIR_ROOT/ddclient/ +backupRootDirectory /etc/letsencrypt/ $BACKUP_DIR_ROOT/letsencrypt/ +backupRootDirectory /etc/nginx/ $BACKUP_DIR_ROOT/nginx/ +backupRootDirectory /etc/ssh/ $BACKUP_DIR_ROOT/ssh/ +backupRootDirectory /etc/wireguard/ $BACKUP_DIR_ROOT/wireguard/ +backupRootDirectory /etc/docker/daemon.json $BACKUP_DIR_ROOT/docker/ + ##################### ### upload backup ### #####################