Automatic file transfer between PHP servers

Asked

Viewed 376 times

0

I’m creating an application that backs up files to linux servers. It already automatically enters 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 prior authentication, and by PHP I can not get the server response of this authentication.

What would be the best way to make this system? And has how to do it by SFTP?

  • 1

    really need to go through all this complication? could not solve with a wget on the downloading server? (wget is mere example)

  • you want to take a full backup of the data and the application or you just want to send a copy of a specific file to another server?

  • I want from server A I connect to server B and transfer the file from B to C. Daniel, I believe that for the task to be fully automated wget would not work very well.

  • You can do one job in cron, create a script to create the backup and another to give a wget in the backup. So vc transfers from one to another and can schedule and even check the backup execution. I’m commenting, but if you believe it can work as soon as I can write a detailed answer

  • Have you considered rsync? rsync is a powerful tool to do what you want. It synchronizes files between locations (remote or not) in a differential way. It only copies what has changed. It is standard in any Linux distribution.

  • An important detail: SCP is a secure file copy on top of the SSH protocol. It is possible to authenticate SSH without password between two servers. It’s a very simple process to do, including.

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.