Sicherung Dateien auf BackupHD mit Rsync/en

Aus EUserv Wiki

(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
 
Zeile 1: Zeile 1:
{{Languages|Sicherung_Dateien_auf_BackupHD_mit_Rsync}}
{{Languages|Sicherung_Dateien_auf_BackupHD_mit_Rsync}}
-
[[Kategorie:Cloud]]
+
[[Kategorie:Cloud/en]]
'''''Save my files to my BackupHD with rsync'''''
'''''Save my files to my BackupHD with rsync'''''
__TOC__
__TOC__

Aktuelle Version vom 08:51, 11. Sep. 2019

Save my files to my BackupHD with rsync

Inhaltsverzeichnis

Save my files to my BackupHD with rsync

General

If you have a Online Storage at EUserv, you can backup your data via rsync there. This tutorial is limited to the easiest and most useful fuctions. More detailed information you can find the guide of rsync (under Linux man rsync).


Save my files to my BackupHD with rsync

Activating of rsync

To use rsync for your Online Storage, you have to activate the function in te customer center. Please proceed as follows:

  • Log into the customer center under http://support.euserv.de with your customer ID and your password.
  • Click in the left menu on Contracts and select your Online Storage contract.


Datei:Backuphd_rsync_en.png


  • Click on Verwaltung.


Datei:Backuphd_rsync_1_en.png


  • Check Rsync aktiv and cklick on Ändern next to your Online Storage account.


Datei:Backuphd_rsync_2_en.png


Your Online Storage will be activated for rsync within 24 h.


Connecting to Online Storage via rsync

Creating connection to Online Storage via rsync

To establish a rsync connection to Online Storage, enter the following command:

rsync [user]@[server]::[module]

[user] - your FTP account
[server] - in case of Online Storage e.g. rsync1.euserv.de
[module] - your FTP account

Hint: Your FTP account must be entered twice to ensure your FTP account has the access for the corresponding rsync module.


Encrypting of rsync connection via SSH

To encrypting the data transfer via SSH connection, enter the following command:

rsync -e ssh [user]@[server]::[module]

[user] - your FTP account
[server] - in case of Online Storage e.g. rsync1.euserv.de
[module] - your FTP account
-e ssh - use SSH connection

If you use the connection via SSH you must entered your password twice. Once for the connection via SSH and once for the rsync connection.

Alternative: Rsync via stunnel


Examples

1. Simple command to backup of EUserv Online Storage:

The file /etc/resolv.conf ahould be saved in folder /backup/ on your server.

rsync /etc/resolv.conf -e ssh --progress ftpbackup-1234@rsync1.euserv.de::ftpbackup-1234/backup/

--progress - This parameter shows a progress bar of the transfer.


2. Incremental backup

The folder /var/www/ should be completely saved on the Online Storage.

rsync -avuzR -e ssh /var/www/ --progress ftpbackup-1234@rsync1.euserv.de::ftpbackup-1234

-a Archie Mode - receipt of file attributes
-u update - overwrite files, if they are newer
-v verbose - extended output
-z compress - compression to save bandwidth
-R relative - uses the full path on the server, the backup will be created in the folder /var/www/ on the server (without -R in the folder /www/)


3. Backup without password

If you use the parameter "--password-file" you can use rsync, without entering the password by every connection.

If you want to use SSH encrytion, the tool sshpass will be needed.

Install sshpass on your server with the following command (for Debian):

sudo apt-get install sshpass

sshpass can be alternatively compiled. http://sourgeforge.net/projects/sshpass/

Create a new file, which includes the password for rsync e.g. /root/rsync_pass. The file should be belong to the user which runs the rsync command and has the user-rights 700.

The backup progress is taken place with the following command:

sshpass -f /root/rsync_pass /usr/bin/rsync -e ssh --password-file /root/rsync_pass [directory] [user]@[server]::[module]

For more information:

man rsync


Enabling key-based access for rsync

To set the SSH key for rsync connections, proceed as follows:

  • Log in to the customer panel under http://support.euserv.de with your customer ID and your password.
  • Choose Contracts from the left menu and select your Online Storage contract.


Datei:Backuphd_rsync_en.png


  • Click on Verwaltung.


Datei:Backuphd_rsync_1_en.png


  • Click the Ändern button in the view FTP-Backupserver Konfiguration.
  • Enter your SSH key under öffentlicher Schlüssel zur Authentifizierung über OpenSSH in the following format: ssh-rsa<base64 coded array>[= <username>@<host>].


Datei:Backuphd_rsync_3_1.png


  • Finally, click the Save button.

Your SSH key has now been set for the rsync connection.