In our example, we want to backup the /var/www folder from a GNU/Linux client that has the 192.168.1.2 IP address.
Add the client
In order to add a new client, we have to click on the Add Client button, and we will face a self-documented form where we will enter the client data.
In our example,
Name: My Linux Client
Once we have enter this data, we will click on the Save button and we will see the new client in the main page.
As this has to be an automated proccess, our server needs to use the correct credentials to connect to "My Linux Client", but we haven't given this information in the client configuration. As long as we are using the SSH protocol, we will use the public/private key pair.
We can download the Elkarbackup server public key from the Configuration menu --> Manage parameters.
An alternative way to download the public key
You can also dowload the public key directly into your client using the CLI with
curl -k https://<elkarbackup-server-address>/config/publickey/get
Now, we have to configure this public key in the GNU/Linux client. Once it is done, we will be able to automatice the ssh connections needed for the backup proccess. In this backup connections, we have two roles:
- ElkarBackup Server: It has the client role in the connection.
- GNU/Linux Client: It has the server role in the ssh connection, so it is neccesary to install there the openssh-server package if it is not previosly installed.
Now we will issue this command in order to copy the newly downloaded public key in the client.
ssh-copy-id -i Publickey.pub firstname.lastname@example.org
Take into account that we are using the root user in the client machine. As you could imagine, you need to know the root's password in the client machine.
If you don't have a linux machine to issue this command, you can do it from a console in the Elkarbackup server. In this case, you can issue the command using the path where the public key is stored:
root@elkarbackup:~# ssh-copy-id -i /var/lib/elkarbackup/.ssh/id_rsa.pub email@example.com
Another package that we need in the GNU/Linux client is rsync, so if it isn't installed, we can install it with this command:
root@LinuxClient:~# apt-get install rsync
Add the job
The next step is to create the job. As we have said before, we want to backup the /var/www folder, so we click in the Add job button (+)
We will receive a self-documented form where it is explained which data we have to fill. In our example, we will change only this fields:
- Name: www
- Path: /var/www
- Description: Apache Web Server Folders
- Policy: Default policy
Just click on Save and the task will be listed in the main page as shown in the following screenshot
As you noticed, the Last log entry and Last Result columns don't show anything yet. Sooner than later, you will noticed that in these columns we will see the last execution timestamp and it's state.
But when? It depends on its Policy configuration. We have assigned the Default Policy to this job, so if we see how it is configurated we could see which are it's schedule and retention policy.
To better understand the concept of policies, it is convenient to have a clear understanding of the concepts explained in the section "A review of concepts: Rsnapshot", since it is the logic used in our application. In the end we will go deeper into this part.
If we let the time (in this example some days) to make the first copies and then we click on the Restore button we will see the result
As we can see the folder **Daily.0 **contains the data of the last copy, but we have also more folders containing backups made in previous days. If we go into any of them we can get to the concrete file that we are interested in recovering. We can download a single file or a compressed folder with many files inside.
In the Advanced options section you can customize also some parameters related to the ssh and rsync connections, as the ssh connection port, bandwith used in the connection, etc.