Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to securely transfer

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.

like image 209
michaeltk Avatar asked Feb 02 '26 06:02

michaeltk


1 Answers

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...)

like image 146
Richard Harrison Avatar answered Feb 05 '26 04:02

Richard Harrison



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!