Using rsync is the easiest way to continuously update your site.
You’ll need sftp access to setup rsync so make sure you can sftp to your site first.
The rsync command
You can copy files to your server using rsync over SSH via:
rsync -e 'ssh -p 2022' -avz file.txt admin_123@wps_xyz.mindspun.io:
where:
file.txt
is the file or directory you want to copy.admin_123
is your username and site id separated by an underscore.wp_xyz
is your server name.
Again, you can use any valid hostname for your site. See the rsync
documentation for further information about the *many* supported rsync options.
Using SSH keys to securely avoid entering your password
Create a file named admin.authorized_keys
where ‘admin’ is the literal username of the desired user. Each line of the file should contain a public ssh key. For instance, you may create an initial file like:
cat ~/.ssh/id_rsa.pub > admin.authorized_keys
The format of this file is the same as a regular authorized_keys
file found in the home .ssh
directory.
Once this file exists, sftp to the site and run the following commands:
mkdir _home
cd _home
mkdir ssh
put admin.authorized_keys
chmod 0400 admin.authorized_keys
And quit out of sftp.
When you run rsync
as above, you will no longer be prompted for a password.