diff --git a/src/freedombone-backup-local b/src/freedombone-backup-local index 54115e49..1553de80 100755 --- a/src/freedombone-backup-local +++ b/src/freedombone-backup-local @@ -34,19 +34,6 @@ COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt export TEXTDOMAIN=${PROJECT_NAME}-backup-local export TEXTDOMAINDIR="/usr/share/locale" -# directories to be backed up (source,dest) -backup_dirs=( - "/etc/letsencrypt, letsencrypt" - "/var/lib/dokuwiki, wiki" - "/etc/dokuwiki, wiki2" - "/etc/ssl, ssl" - "/var/spool/mlmmj, mailinglist" - "/var/lib/prosody, xmpp" - "/etc/nginx/sites-available, web" - "/home/$ADMIN_USERNAME/.ipfs, ipfs" - "/var/cache/minidlna, dlna" -) - USB_DRIVE=/dev/sdb1 USB_MOUNT=/mnt/usb @@ -269,12 +256,24 @@ function backup_users { cp /home/$USERNAME/.procmailrc /home/$USERNAME/tempbackup backup_directory_to_usb /home/$USERNAME/tempbackup procmail/$USERNAME fi - fi done } function backup_directories { + # directories to be backed up (source,dest) + backup_dirs=( + "/etc/letsencrypt, letsencrypt" + "/var/lib/dokuwiki, wiki" + "/etc/dokuwiki, wiki2" + "/etc/ssl, ssl" + "/var/spool/mlmmj, mailinglist" + "/var/lib/prosody, xmpp" + "/etc/nginx/sites-available, web" + "/home/$ADMIN_USERNAME/.ipfs, ipfs" + "/var/cache/minidlna, dlna" + ) + for dr in "${backup_dirs[@]}" do source_directory=$(echo $dr | awk -F ',' '{print $1}' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')