I'm creating an application that backs up files on linux servers. It is already automatically entered on the server and sends commands to perform the backup. My problem is that I want to move the backup file to another server and I'm not getting it. For an automatic system, the use of scp is not valid, since it requires a previous authentication, and by PHP I can not get the server response of this authentication.
What would be the best way to do this? And how can you do this for SFTP?