FreePBX backup module - FTP servers do not support SCP EXEC anymore

Hey

More and more FTP vendors are deprecating the SCP protocol, and therefor it is not possible to use the backup module anymore.

Are there any plans to use OpenSSH to connect and transfer backup files to a secure FTP server, or how do you see a solution??

Since I am not an application developer, I need to replace the SCP commands with

#!/bin/bash

# This script assumes that a public / private key pair has been setup already between the
# client account that is running the script on the local machine and the fx_zzzzz server
# account on OCLC's filex-m1.oclc.org host

sftp -v [email protected] <<EOF
lcd /zzzzz/bib/xfer/out/
cd /xfer/metacoll/in/bib/
put 1234567.zzzzz.bibs.20200101.mrc
quit
EOF

# Best practice is to assign the sftp return code to a variable for further use, because
# ${?} is fleeting and only shows the condition code of the immediately preceding command

SFTP_RETURN_CODE=${?}

# If the return code is non-zero then the upload was not successful

if [[ 0 != ${SFTP_RETURN_CODE} ]]
   then
   echo "bib upload for zzzzz failed"
   exit ${SFTP_RETURN_CODE}
else
   echo "bib upload for zzzzz was successful"
fi

exit 0

Soruce: Upload files using SFTP or SCP commands - OCLC Support

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.