views:

48

answers:

3

I have two servers -- a backend server, and a frontend server. Every night, the backend server generates static .html files, which are then compressed into .tar format.

I need to write a script that resides on the backend server that will transfer the .tar file to the frontend server, and then decompress that .tar file into to the public web directory of the frontend server.

What is the standard, secure way to do this?

Thanks in advance.

+3  A: 

Either use SFTP or just plain FTP on an secure, encrypted connection.

Daniel DiPaolo
+4  A: 

best option for doing this is rsync. It will handle the compression for you and with a sensibly constructed script transfer the minimum. With rsync you don't need to worry about the compression or transfer, just realise that it works. With the right paramters (i.e. ssh

Example rsync:

  /usr/bin/rsync -vxSHrae "ssh -l backups" /opt/redmine [email protected]::redmine

(replace the obvious and use ssh keys...)

Richard Harrison
+1 This is the correct answer.
Rook
Thanks to your answer, I've been using rsync for the past few months. It's exactly what I was looking for. Thank you!
michaeltk
A: 

Use IPSec and then copy the files using whatever you currently use.

You'll get authentication (so you know who you're talking to), encryption (so no-one can read the data) and integrity checking (so no-one can twiddle with the bits.)

Michael Howard-MSFT