Sicherung Dateien auf BackupHD mit Rsync/en

Aus EUserv Wiki

(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
(Die Seite wurde neu angelegt: „{{Languages|Sicherung_Dateien_auf_BackupHD_mit_Rsync}} Kategorie:Cloud/en '''''Save my files to my BackupHD with rsync''''' __TOC__ <div style= "font-size: 1.…“)
 
(Der Versionsvergleich bezieht 4 dazwischenliegende Versionen mit ein.)
Zeile 6: Zeile 6:
'''Save my files to my BackupHD with rsync'''
'''Save my files to my BackupHD with rsync'''
</div>
</div>
-
== General ==
 
-
Rsync provides a vast number of options. This how-to  confines to the most simple and common functions. More detailed information can be found in the rsync manual (under Linux: man rsync).
 
-
In order to use BackupHD you need to enable the function in the customer center. To this click the menu point "Verwaltung" after selecting your contract and enable the tick under "Rsync aktiv". After that click the "Ändern" button. Your BackUP will be enabled for rsync within 24 hours.
+
= 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). 
-
=== The general command reads: ===
 
-
''<nowiki>#</nowiki> rsync [user]@[server]::[module]<br>''
+
= Save my files to my BackupHD with rsync =
 +
== Activating of rsync ==
-
<nowiki>[user]</nowiki> - Your FTP account<br>
+
To use rsync for your Online Storage, you have to activate the function in te customer center. Please proceed as follows:
-
<nowiki>[server]</nowiki> - In case of the BackupHD for example rsync1.euserv.de<br>
+
-
<nowiki>[module]</nowiki> - Your FTP account<br>
+
-
Hint: The FTP Account has to be stated twice, to ensure only the FTP account is allowed to access the respective rsync module.
+
* 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.
-
=== Encryption via SSH ===
+
<br>
 +
<center>
 +
[[Datei:Backuphd_rsync_en.png]]
 +
</center>
 +
<br>
-
To encrypt the file transfer via an SSH connection enter the parameter "-e ssh".
+
* Click on '''Verwaltung'''.
-
<nowiki>#</nowiki> rsync -e ssh  ''[user]@[server]::[module]<br>''
+
<br>
 +
<center>
 +
[[Datei:Backuphd_rsync_1_en.png]]
 +
</center>
 +
<br>
-
<nowiki>[user]</nowiki> - Your FTP account<br>
+
* Check '''Rsync aktiv''' and cklick on '''Ändern''' next to your Online Storage account.
-
<nowiki>[server]</nowiki> - In case of the BackupHD for example rsync1.euserv.de<br>
+
-
<nowiki>[module]</nowiki> - Your FTP account<br>
+
-
<nowiki>-e ssh</nowiki>  - Using an SSH connection<br>
+
-
If you are using the connection via SSH you have to enter your password twice. The first time for the SSH connection and the second time for the rsync connection.
+
<br>
 +
<center>
 +
[[Datei:Backuphd_rsync_2_en.png]]
 +
</center>
 +
<br>
-
alternative: [[Rsync Verbindung zur BackupHD verschlüsseln|Rsync via stunnel]]
+
Your Online Storage will be activated for rsync within 24 h.
-
=== Examples: ===
 
-
'''<nowiki>1.</nowiki> Simple command for backing up the EUserv BackupHD:<br>'''
+
== Connecting to Online Storage via rsync ==
 +
=== Creating connection to Online Storage via rsync ===
-
The file /etc/resolv.conf is supposed to be saved in the folder  /backup/ on the server.
+
To establish a rsync connection to Online Storage, enter the following command:
-
''<nowiki>#</nowiki> rsync /etc/resolv.conf -e ssh --progress ftpbackup-1234@rsync1.euserv.de::ftpbackup-1234/backup/''<br>
+
<pre>
 +
rsync [user]@[server]::[module]
 +
</pre>
-
<nowiki>--progress</nowiki> - This parameter displays a progress bar during the transfer.<br>
+
[user] - your FTP account<br>
 +
[server] - in case of Online Storage e.g. rsync1.euserv.de<br>
 +
[module] - your FTP account<br>
-
'''<nowiki>2.</nowiki> Incremental backup<br>'''
+
Hint: Your FTP account must be entered twice to ensure your FTP account has the access for the corresponding rsync module.
-
The folder /var/www/ is supposed to be saved completely on the BackupHD.
 
-
''<nowiki>#</nowiki> rsync -avuzR -e ssh /var/www/ --progress ftpbackup-1234@rsync1.euserv.de::ftpbackup-1234''<br>
+
=== Encrypting of rsync connection via SSH ===
-
<nowiki>-a</nowiki> Archive Mode - Keeps the file attributes<br>
+
To encrypting the data transfer via SSH connection, enter the following command:
-
<nowiki>-u</nowiki> update - Only overwrites files if they are more up-to-date.<br>
+
-
<nowiki>-v</nowiki> verbose - Extended output<br>
+
-
<nowiki>-z</nowiki> compress - Compressing in order to save bandwidth.<br>
+
-
<nowiki>-R</nowiki> relative - Uses the complete path statement on the server, i.e. the backup will be stored in the /var/www/ folder on the server (without -R this will take place in the folder /www/)
+
-
'''<nowiki>3.</nowiki> Backup without password prompt<br>'''
+
<pre>
 +
rsync -e ssh [user]@[server]::[module]
 +
</pre>
 +
[user] - your FTP account<br>
 +
[server] - in case of Online Storage e.g. rsync1.euserv.de<br>
 +
[module] - your FTP account<br>
 +
-e ssh - use SSH connection
-
With  "--password-file" you can use rsync without a password prompt
+
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.
-
If you use ssh encryption, the tool sshpass is required.
+
Alternative: [[Rsync Verbindung zur BackupHD verschlüsseln/en|Rsync via stunnel]]
-
On Debian based distributions you can install sshpass with apt-get/aptitude: sudo apt-get install sshpass. Alternatively you can compile sshpass from source. http://sourceforge.net/projects/sshpass/
 
-
Create a textfile that includes your rsync password, e.g. /root/rsync_pass. This file should belong to the user, that is executing the rsync command. it should have the rights 700.
+
==== Examples ====
-
The backup can be executed with the following command:
+
'''1. Simple command to backup of EUserv Online Storage:'''
-
<nowiki>#</nowiki> sshpass -f /root/rsync_pass  /usr/bin/rsync -e ssh --password-file /root/rsync_pass [Verzeichnis] ''[user]@[server]::[module]''
+
The file /etc/resolv.conf ahould be saved in folder /backup/ on your server.
 +
<pre>
 +
rsync /etc/resolv.conf -e ssh --progress ftpbackup-1234@rsync1.euserv.de::ftpbackup-1234/backup/
 +
</pre>
-
Für weitere Informationen:
+
--progress - This parameter shows a progress bar of the transfer.
-
''<nowiki>#</nowiki> man rsync''
+
 
 +
'''2. Incremental backup'''
 +
 
 +
The folder /var/www/ should be completely saved on the Online Storage.
 +
 
 +
<pre>
 +
rsync -avuzR -e ssh /var/www/ --progress ftpbackup-1234@rsync1.euserv.de::ftpbackup-1234
 +
</pre>
 +
 
 +
-a Archie Mode - receipt of file attributes<br>
 +
-u update - overwrite files, if they are newer<br>
 +
-v verbose - extended output<br>
 +
-z compress - compression to save bandwidth<br>
 +
-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.<br>
 +
 
 +
If you want to use SSH encrytion, the tool sshpass will be needed.<br>
 +
 
 +
Install sshpass on your server with the following command (for Debian):
 +
 
 +
<pre>
 +
sudo apt-get install sshpass
 +
</pre>
 +
 
 +
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:
 +
 
 +
<pre>
 +
man rsync
 +
</pre>
 +
 
 +
 
 +
=== 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.
 +
 
 +
<br>
 +
<center>
 +
[[Datei:Backuphd_rsync_en.png]]
 +
</center>
 +
<br>
 +
 
 +
* Click on '''Verwaltung'''.
 +
 
 +
<br>
 +
<center>
 +
[[Datei:Backuphd_rsync_1_en.png]]
 +
</center>
 +
<br>
 +
 
 +
* 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>]'''.
 +
 
 +
<br>
 +
<center>
 +
[[Datei:Backuphd_rsync_3_1.png]]
 +
</center>
 +
<br>
 +
 
 +
* Finally, click the '''Save''' button.
 +
 
 +
Your SSH key has now been set for the rsync connection.

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.