This commit is contained in:
Bob Mottram 2015-12-08 21:35:17 +00:00
parent 2d1add80ae
commit 8004017769
1 changed files with 13 additions and 14 deletions

View File

@ -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:]]*$//')