- 1.Trellis Rsync Media
To quickly sync media from one Trellis server to another to copy media you can rsync media. Using the cli too rsync you can copy media from one server to another with one command from the terminal
From one a Trellis server to another you can use rsync. You have to make sure you start with the source and then add the destination:
ssh -o ForwardAgent=yes firstname.lastname@example.org "rsync -aze 'ssh -o StrictHostKeyChecking=no' --progress /srv/www/origin.com/shared/uploads/ email@example.com:/srv/www/destination.com/shared/uploads/"
Now let’s get into detail on the command here shall we?
First SSH Command
As you can see we have multiple ssh parameters:
- -o options – allows you to add ssh options
- ForwardAgent= yes – option added to make ForwardAgent work so we can ssh into destination after ssh-in into source without stoppping
We also have rsync itself with a few parameters:
- a – archive mode
- z – gzip compression
- e – specify remote shell to use
Second SSH Command
The second ssh command also using the option parameter but now indicates StricHostKeyChecking as ‘no’ and with progress.
… when you do ssh to a machine for the 1st time (or whenever there is a key change in the remote machine), you will be prompted to say ‘yes’ for authenticity of host. Geek Stuff Source Article
So to avoid this and make sure things go smoothly we turn this off in this command. So not permanently in the sshd_config.
NB Post inspired by Ben’s Post