![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
|
Tutorials & Tips The place to find Ubuntu related Tips & Tricks. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Gee! These Aren't Roasted!
![]() |
HowTo: Use Grsync and OpenSSH to sync your /home directory over a network
This tutorial will cover three things:
1) installing rsync, the Grsync GUI for rsync, and OpenSSH; 2) using rsync over an OpenSSH connection to syncronize your /home directory between two computers; and 3) excluding files you do not want to sync. Reason: I use a desktop and a laptop. I want to keep my /home directory on both identical, since I use the same software, etc., on both. OpenSSH provides a secure connection if you are syncing remotely over the internet, and is a really easy way to connect to another computer on your network. 1) Installing rsync, Grsync, and OpenSSH This is a piece of cake. Copy each of the following lines into the terminal: Code:
sudo apt-get install grsync sudo apt-get install openssh-server Click the +Add button and name your new session something like "50words /home" so you can easily get to it again. In the Source and Destination fields, enter the source--the computer you are going to sync from--in the first field. In my case: Code:
/home/50words/ In the destination field--the second field--enter the computer you are going to sync to. You have to do this using the computer's IP address. (If you don't know it, use the ifconfig command in a terminal. Or use System > Administration > Network Tools, and select the Network Device to see your IP Address next in the IPv4 row, if you are using Ubuntu.) Enter it like so: Code:
192.168.0.10:/home/50words/ Code:
-e ssh 3) Now, there are almost certainly some files you do not want to sync. For example, it is time-consuming to sync my Firefox cache, so I don't do it; I have a fast internet connection, so it does not really matter to me if it is synced up. It takes a lot of text to exclude multiple files and folders using the command line. It is easier to use a separate file to identify the files and folders to exclude. First, in the Additional options field, enter "--exclude" and the text file name in which you will list your files or directories to exclude. For example, here is my path to my exclusion file: Code:
--exclude-from=/home/50words/rsync-exclude.txt Code:
/home/50words/.mozilla/firefox/*/Cache /home/50words/.beagle Edit: If you want to do a two-way sync, instead of a one-way sync, give Unison a try. It works just as well over SSH, and does a fantastic job of two-way syncing.
__________________
Last edited by 50words; October 10th, 2008 at 11:24 AM.. |
|
|
|
|
|
#2 |
|
Fresh Brewed Ubuntu
![]() |
Re: HowTo: Use Grsync and OpenSSH to sync your /home directory over a network
Thanks for this post. In my case I use Grsync to make backups over the netword and I don't have to put the -e ssh to achieve that. Also, I'm trying to make an exclusion list, but Grsync is always insisting in copying the folder I specified. I'm still trying to figure out why.
Anyway, thanks for this howto. Very useful. Last edited by henriquemaia; July 16th, 2008 at 11:57 AM.. |
|
|
|
|
|
#3 | ||
|
Fresh Brewed Ubuntu
![]() |
Re: HowTo: Use Grsync and OpenSSH to sync your /home directory over a network
Quote:
Quote:
Thanks for all your help (it was all already there |
||
|
|
|
|
|
#4 |
|
First Cup of Ubuntu
![]() Join Date: Jul 2008
Beans: 1
|
Re: HowTo: Use Grsync and OpenSSH to sync your /home directory over a network
I followed your instructions, but I'm getting these erros:
luiz@aganp:~$ rsync -r -t -v --progress -e ssh /home/luiz/Música/ 10.1.133.161:/home/marelo/Músicas/ ssh: connect to host 10.1.133.161 port 22: Connection refused rsync: connection unexpectedly closed (0 bytes received so far) [sender] rsync error: unexplained error (code 255) at io.c(454) [sender=2.6.9] Both computers are on the same network and I've shared the "Músicas" folders at the 10.1.133.161 computer with all the permissions granted... What could be the problem?... Thanks! |
|
|
|
|
|
#5 |
|
Gee! These Aren't Roasted!
![]() |
Re: HowTo: Use Grsync and OpenSSH to sync your /home directory over a network
I am not all that sophisticated at troubleshooting networking issues, but it looks like you may have a network problem to solve, first.
__________________
|
|
|
|
|
|
#6 | |
|
First Cup of Ubuntu
![]() |
Re: HowTo: Use Grsync and OpenSSH to sync your /home directory over a network
Quote:
Seems that the 10.1.133.161 computer might not have SSH installed... try to ssh on to it without rsync ! |
|
|
|
|
|
|
#7 |
|
A Carafe of Ubuntu
![]() Join Date: Jun 2007
Beans: 96
|
Re: HowTo: Use Grsync and OpenSSH to sync your /home directory over a network
Marelo, can you ping 10.1.133.161? if yes, then that is a good sign. now you have to ensure there's nothing blocking ssh (ie firewall or router if it's going across the 'net)
|
|
|
|
|
|
#8 |
|
First Cup of Ubuntu
![]() Join Date: Oct 2008
Beans: 2
|
Re: HowTo: Use Grsync and OpenSSH to sync your /home directory over a network
I'm pretty new to linux, would ssh also work over the internet and not only on the intranet?
|
|
|
|
|
|
#9 |
|
Gee! These Aren't Roasted!
![]() |
Re: HowTo: Use Grsync and OpenSSH to sync your /home directory over a network
Yup. SSH is at its best over the internet. The internet is just one giant network.
__________________
|
|
|
|
|
|
#10 |
|
First Cup of Ubuntu
![]() Join Date: Oct 2008
Beans: 2
|
Re: HowTo: Use Grsync and OpenSSH to sync your /home directory over a network
Thank you!
|
|
|
|
| Bookmarks |
| Tags |
| how to, rsync, ssh |
| Thread Tools | |
| Display Modes | |
|
|