diff --git a/README.md b/README.md index 3e0e788..ee0a028 100644 --- a/README.md +++ b/README.md @@ -82,8 +82,10 @@ Here we will put all SSH public keys from our borg clients, we want to backup. E That means every client get's it's own repository. So you might want to use the hostname of the client as the name of the sshkey file. +Hidden files & files inside of hidden directories will be ignored! + ``` -F.e. /sshkeys/clients/webserver.mydomain.com +e.g. /sshkeys/clients/webserver.mydomain.com ``` Than your client would have to initiat the borg repository like this: diff --git a/data/run.sh b/data/run.sh index d8eca9f..17046e9 100755 --- a/data/run.sh +++ b/data/run.sh @@ -27,7 +27,7 @@ for dir in BORG_DATA_DIR SSH_KEY_DIR ; do exit 1 fi - if [ "$(find ${SSH_KEY_DIR}/clients -type f | wc -l)" == "0" ] ; then + if [ "$(find ${SSH_KEY_DIR}/clients ! -regex '.*/\..*' -a -type f | wc -l)" == "0" ] ; then echo "ERROR: No SSH-Pubkey file found in ${SSH_KEY_DIR}" exit 1 fi @@ -48,7 +48,7 @@ echo " * Starting SSH-Key import..." # Add every key to borg-users authorized_keys rm /home/borg/.ssh/authorized_keys &>/dev/null -for keyfile in $(find "${SSH_KEY_DIR}/clients" -type f); do +for keyfile in $(find "${SSH_KEY_DIR}/clients" ! -regex '.*/\..*' -a -type f); do client_name=$(basename ${keyfile}) mkdir ${BORG_DATA_DIR}/${client_name} 2>/dev/null echo " ** Adding client ${client_name} with repo path ${BORG_DATA_DIR}/${client_name}"