Editing Backup Linux desktop data using rsync

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 25: Line 25:


==Setting up Synology for rsync via SSH/RSH==
==Setting up Synology for rsync via SSH/RSH==
When using ssh no rsync deamon is used on the DiskStation. However you need to have a valid public / private key pair, so the DiskStation can recognize the Linux machine. Follow the following steps ([http://troy.jdmz.net/rsync/index.html adopted from here])
<b>ToDo</b>: Elaborate
 
<b>Generate they key pair</b>
 
<code>
mkdir ~/.sshkeys<br />
cd ~/.sshkeys<br />
ssh-keygen -t dsa -b 1024 -f ~/.sshkeys/diskstation-rsync-key
</code>
 
Generating public/private dsa key pair.
Enter passphrase (empty for no passphrase): [press enter here]<br />
Enter same passphrase again: [press enter here]<br />
Your identification has been saved in ... diskstation-rsync-key. <br />
Your public key has been saved in  ... diskstation-rsync-key. <br />
( where  ... stands for your directory )<br />
<code>
chmod 600 diskstation-rsync-key
</code>
 
If you want to connect without using a passphrase, you must not enter any passphrase when ask (just it the "Enter" key)
 
<b>Transfer the keys</b><br />
First, you will have to enable the "homes" directory" through your Synology web interface. (all "homes" are created under directory ''/volume1/homes/'')
Use your file manager (e.g. Nautilus) to navigate to <code>[YourUserName]@smb://diskstation/home/</code><br />
Create a directory <code>.ssh</code> and copy diskstation-rsync-key.pub there.<br />
Now open a SSH connection to the diskstation to continue:<br />
<code>
ssh user@diskstation [Enter password here]<br />
cd /volume1/homes/[YourUserName]/.ssh<br />
ls -l
</code>
 
If there is already a "authorized_keys" file you skip the first line of the following code:
 
<code>
touch authorized_keys<br />
cat diskstation-rsync-key.pub >> authorized_keys<br />
rm diskstation-rsync-key.pub<br />
chmod 600 authorized_keys<br />
</code>
You can restrict the use of this key for specific commands or IP addresses ([http://troy.jdmz.net/rsync/index.html see here]).<br />
Exit from the SSH session. Now you are ready to test the keys with the following command:<br />
<code>
ssh -i ~/.sshkeys/diskstation-rsync-key [YourUserName]@diskstation
</code><br />
If you get a ssh session without a password prompt the ssh connection using your new keys works.<br />
 
<b>Sample backup command</b><br />
<code>
rsync --recursive --copy-links --times --verbose  --progress -e "ssh -i ~/.sshkeys/diskstation-rsync-key" \<br />
/home/[localusername] [YourUserName]@diskstation:/volume1/homes/[YourUserName]/backup
</code><br />
This will:
* Connect through SSH to your Synology, using the set of key you previously created
* Copy recursively all from /home/[localusername] to your Synology, within /volume1/homes/[YourUserName]/backup directory (no need to create "backup")
* Copy referents to symbolic links
* Preserve ties from your files
* Show you the progress from copy (not useful if you are running it with a cron)
<b>TODO:</b> Explain a little more


==Backing up your Linux workstation using rsync==
==Backing up your Linux workstation using rsync==
Line 93: Line 34:
<br />[http://qtdtools.doering-thomas.de/page.php?seite=0&sub=0&lang=en QTDSync]
<br />[http://qtdtools.doering-thomas.de/page.php?seite=0&sub=0&lang=en QTDSync]
<br />[http://gadmintools.flippedweb.com/index.php?option=com_content&task=view&id=51&Itemid=38 GAdmin tool for rsync]
<br />[http://gadmintools.flippedweb.com/index.php?option=com_content&task=view&id=51&Itemid=38 GAdmin tool for rsync]
<br />[http://www.aboutmyip.com/AboutMyXApp/DeltaCopy.jsp DeltaCopy] (Windows rsync GUI)
<br /><b>ToDo</b>: complete the list of Linux GUI applications using rsync.
<br /><b>ToDo</b>: complete the list of Linux GUI applications using rsync.
==Synchronize Sabnzbd and Synology==
If you have a server somewhere with Sabnzbd on it and you want to move what you downloaded from the server to your Synology, please have a look to [http://blog.metabaron.net/index.php?post/2011/04/14/Sabnzbd-and-Synology|this blog entry]
[[Category:SynologyWiki]]
[[Category:ToBeExported]]
Please note that all contributions to wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Wiki:Copyrights for details). Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)