From 46e0aba9b3c2aba14fbaf28525b670911c8add60 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 22 Dec 2015 21:36:43 +0000 Subject: [PATCH] Separate remote backips file with spaces --- src/freedombone-backup-remote | 8 +++++--- src/freedombone-remote | 6 +++--- src/freedombone-restore-remote | 4 +++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/freedombone-backup-remote b/src/freedombone-backup-remote index 21ac8691..6572892b 100755 --- a/src/freedombone-backup-remote +++ b/src/freedombone-backup-remote @@ -533,13 +533,15 @@ while read remote_server do # Get the server and its password # Format is: - # username@domain:/home/username + # username@domain /home/username REMOTE_SERVER=$(echo "${remote_server}" | awk -F ' ' '{print $1}') if [ $REMOTE_SERVER ]; then - REMOTE_DOMAIN=$(echo "${remote_server}" | awk -F ':' '{print $1}' | awk -F '@' '{print $2}') + REMOTE_DOMAIN=$(echo "${remote_server}" | awk -F ' ' '{print $1}' | awk -F '@' '{print $2}') REMOTE_SSH_PORT=$(echo "${remote_server}" | awk -F ' ' '{print $2}') - REMOTE_PASSWORD=$(echo "${remote_server}" | awk -F ' ' '{print $3}') + REMOTE_DIRECTORY=$(echo "${remote_server}" | awk -F ' ' '{print $3}') + REMOTE_PASSWORD=$(echo "${remote_server}" | awk -F ' ' '{print $4}') NOW=$(date +"%Y-%m-%d %H:%M:%S") + REMOTE_SERVER=$REMOTE_SERVER:$REMOTE_DIRECTORY echo "$NOW Starting backup to $REMOTE_SERVER" >> /var/log/remotebackups.log diff --git a/src/freedombone-remote b/src/freedombone-remote index dd1ad0d5..c732c500 100755 --- a/src/freedombone-remote +++ b/src/freedombone-remote @@ -196,7 +196,7 @@ function interactive_configuration_remote_backups { dialog --title "Password quality check" --msgbox "The reciprocal password given was too short. It must be at least $MINIMUM_PASSWORD_LENGTH characters" 6 40 else echo ${remote_ssh_reciprocal_username}:${remote_ssh_reciprocal_password}::::/home/${remote_ssh_reciprocal_username}:bash | newusers - echo "$remote_ssh_username@$remote_ssh_domain:$remote_ssh_port//home/$remote_ssh_username $remote_ssh_password" >> $FRIENDS_SERVERS_LIST + echo "$remote_ssh_username@$remote_ssh_domain $remote_ssh_port /home/$remote_ssh_username $remote_ssh_password" >> $FRIENDS_SERVERS_LIST remote_ssh_username="" remote_ssh_domain="" remote_ssh_port="" @@ -206,7 +206,7 @@ function interactive_configuration_remote_backups { entering_remote_backups_ctr=$((entering_remote_backups_ctr + 1)) fi else - echo "$remote_ssh_username@$remote_ssh_domain:$remote_ssh_port//home/$remote_ssh_username $remote_ssh_password" >> $FRIENDS_SERVERS_LIST + echo "$remote_ssh_username@$remote_ssh_domain $remote_ssh_port /home/$remote_ssh_username $remote_ssh_password" >> $FRIENDS_SERVERS_LIST remote_ssh_username="" remote_ssh_domain="" remote_ssh_port="" @@ -216,7 +216,7 @@ function interactive_configuration_remote_backups { entering_remote_backups_ctr=$((entering_remote_backups_ctr + 1)) fi else - echo "$remote_ssh_username@$remote_ssh_domain:$remote_ssh_port//home/$remote_ssh_username $remote_ssh_password" >> $FRIENDS_SERVERS_LIST + echo "$remote_ssh_username@$remote_ssh_domain $remote_ssh_port /home/$remote_ssh_username $remote_ssh_password" >> $FRIENDS_SERVERS_LIST remote_ssh_username="" remote_ssh_domain="" remote_ssh_port="" diff --git a/src/freedombone-restore-remote b/src/freedombone-restore-remote index 3d47e641..c5e4b60c 100755 --- a/src/freedombone-restore-remote +++ b/src/freedombone-restore-remote @@ -70,7 +70,9 @@ fi REMOTE_SERVER=$(grep -i "$SERVER_NAME" $BACKUP_LIST | awk -F ' ' '{print $1}') REMOTE_SSH_PORT=$(grep -i "$SERVER_NAME" $BACKUP_LIST | awk -F ' ' '{print $2}') -REMOTE_PASSWORD=$(grep -i "$SERVER_NAME" $BACKUP_LIST | awk -F ' ' '{print $3}') +REMOTE_DIRECTORY=$(grep -i "$SERVER_NAME" $BACKUP_LIST | awk -F ' ' '{print $3}') +REMOTE_PASSWORD=$(grep -i "$SERVER_NAME" $BACKUP_LIST | awk -F ' ' '{print $4}') +REMOTE_SERVER=$REMOTE_SERVER:$REMOTE_DIRECTORY NOW=$(date +"%Y-%m-%d %H:%M:%S")