Do you have multiple servers? Then it may happen that you want to copy files from one server to another server. To do this properly, we use the tool rsync. We are happy to explain to you how you can use this to copy files.
Copying RSYNC files
There are 2 methods you can use Rsync to copy your files, namely push and pull.
The Pull Method
With the pull method you want to download all files and directories from another server (for example a development server) to your HPW server. What exactly is an HPW server you can read here. You can use rsync on it as follows:
- rsync -avz webmaster@ontwikkel-server.ext:/var/www/html* /var/hpwsites/<u_gebruiker>/website/html/webroot/
The above example assumes that:
- webmaster the account is on the other server where you can access your website files
- develop-server.ext is the hostname of the other server
- all website files are located in the directory /var/www/html
- You replace <user> with the username of your HPW server
The values given in the example above are applicable for the given example. You should adjust these to the correct values for you. If you do not know which values are correct for you, you can contact our hosting experts. They will be happy to look with you.
The Push method
The push method can be recognized by the fact that you upload files to another server, from your HPW server. The difference in these methods is that with the pull method you download files to your hpw server and that you upload files with the push method.
For the push method it is important that 'the other server' is in possession of rsync. In addition, there must be an exception in the firewall of your HPW server.
To copy all files and directories from the current directory to the webroot you can do the following on the other server (not the HPW server):
</span>
<pre>rsync -avz ./* -e "ssh -p 22622" <user>@d-xxxxxxx.host-ed.eu:/var/hpwsi
Related Articles
Edit Hosts File in Windows 10
A question we regularly get from our customers is: “How can we test our website in advance; our website is currently still hosted by another internet company”. If your website is on a Linqhost server, but the domain name of which does not yet refer ...
Migrate Email with ImapSync
When moving your website to LinQhost, transferring the website files and databases is not a problem. When it comes to your e-mail, this becomes a bit more difficult. Here is a step-by-step plan to also migrate your e-mail via imap to your new mail ...
Migrate Email via IMAP with ImapSync
Moving your website to LinQhost is easy, but migrating your email can be a bit more complicated. Fortunately, with ImapSync you can easily transfer your emails to your new mail environment at LinQhost. In this manual we explain step by step how to do ...
Transferring a domain: requesting a domain token or EPP code
Are you planning to transfer your domain? Then you need a domain token or EPP code to make the transfer go smoothly. In this blog we explain how you can easily request this code, so that your transfer goes smoothly. Why do you need a token or EPP ...
Suppress SSH login notifications
We regularly see that the so-called deploy services suffer from output that we generate when logging in via SSH (e.g. pre-login/motd). This output has the function to show the user important information, but in the case of automatic processes this is ...