From 449b0a226cf0a5f566c95ac1d77f1cca18c52b89 Mon Sep 17 00:00:00 2001 From: Boiler-Bit-Room Date: Fri, 16 Feb 2024 12:03:42 -0500 Subject: [PATCH] SFTP StaticChannelBackup (#4382) * Update FAQ.md. Typo: rebuild -> rebuilt (#4223) * SFTP StaticChannelBackup * Update _background.sh To resolve the variables, you have to use double quotes * change back to SCP * change back to scp --------- Co-authored-by: /rootzoll Co-authored-by: Glen Cooper --- home.admin/_background.sh | 44 +++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/home.admin/_background.sh b/home.admin/_background.sh index d8be81c92..e0fb6acb3 100755 --- a/home.admin/_background.sh +++ b/home.admin/_background.sh @@ -513,27 +513,27 @@ do fi fi - # check if a SFTP backup target is set + # check if a SCP backup target is set # parameter in raspiblitz.conf: - # sftpBackupTarget='[USER]@[SERVER]:[DIRPATH-WITHOUT-ENDING-/]' - # optionally a custom option string for the sftp command can be set with - # sftpBackupOptions='[YOUR-CUSTOM-OPTIONS]' + # scpBackupTarget='[USER]@[SERVER]:[DIRPATH-WITHOUT-ENDING-/]' + # optionally a custom option string for the scp command can be set with + # scpBackupOptions='[YOUR-CUSTOM-OPTIONS]' # On target server add the public key of your RaspiBlitz to the authorized_keys for the user # https://www.linode.com/docs/security/authentication/use-public-key-authentication-with-ssh/ - if [ ${#sftpBackupTarget} -gt 0 ]; then + if [ ${#scpBackupTarget} -gt 0 ]; then echo "--> Offsite-Backup SFTP Server" - if [ "${sftpBackupOptions}" == "" ]; then - sftpBackupOptions="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + if [ "${scpBackupOptions}" == "" ]; then + scpBackupOptions="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" fi # its ok to ignore known host, because data is encrypted (worst case of MiM would be: no offsite channel backup) # but its more likely that without ignoring known host, script might not run thru and that way: no offsite channel backup - sftp ${sftpBackupOptions} ${localBackupPath} ${sftpBackupTarget}/ - sftp ${sftpBackupOptions} ${localTimestampedPath} ${sftpBackupTarget}/ + scp ${scpBackupOptions} ${localBackupPath} ${scpBackupTarget}/ + scp ${scpBackupOptions} ${localTimestampedPath} ${scpBackupTarget}/ result=$? if [ ${result} -eq 0 ]; then - echo "OK - SFTP Backup exited with 0" + echo "OK - SCP Backup exited with 0" else - echo "FAIL - SFTP Backup exited with ${result}" + echo "FAIL - SCP Backup exited with ${result}" fi fi @@ -619,27 +619,27 @@ do fi fi - # check if a SFTP backup target is set + # check if a SCP backup target is set # parameter in raspiblitz.conf: - # sftpBackupTarget='[USER]@[SERVER]:[DIRPATH-WITHOUT-ENDING-/]' - # optionally a custom option string for the sftp command can be set with - # sftpBackupOptions='[YOUR-CUSTOM-OPTIONS]' + # scpBackupTarget='[USER]@[SERVER]:[DIRPATH-WITHOUT-ENDING-/]' + # optionally a custom option string for the scp command can be set with + # scpBackupOptions='[YOUR-CUSTOM-OPTIONS]' # On target server add the public key of your RaspiBlitz to the authorized_keys for the user # https://www.linode.com/docs/security/authentication/use-public-key-authentication-with-ssh/ - if [ ${#sftpBackupTarget} -gt 0 ]; then + if [ ${#scpBackupTarget} -gt 0 ]; then echo "--> Offsite-Backup SFTP Server" - if [ "${sftpBackupOptions}" == "" ]; then - sftpBackupOptions="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + if [ "${scpBackupOptions}" == "" ]; then + scpBackupOptions="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" fi # its ok to ignore known host, because data is encrypted (worst case of MiM would be: no offsite channel backup) # but its more likely that without ignoring known host, script might not run thru and that way: no offsite channel backup - sftp ${sftpBackupOptions} ${localBackupPath} ${sftpBackupTarget}/ - sftp ${sftpBackupOptions} ${localTimestampedPath} ${sftpBackupTarget}/ + scp ${scpBackupOptions} ${localBackupPath} ${scpBackupTarget}/ + scp ${scpBackupOptions} ${localTimestampedPath} ${scpBackupTarget}/ result=$? if [ ${result} -eq 0 ]; then - echo "OK - SFTP Backup exited with 0" + echo "OK - SCP Backup exited with 0" else - echo "FAIL - SFTP Backup exited with ${result}" + echo "FAIL - SCP Backup exited with ${result}" fi fi