LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 02-10-2009, 04:53 AM   #1
kenneho
Member
 
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 655

Rep: Reputation: 40
rsync: server vs client


Hello all.


I wish to use rsync to sync some folder from one machine to another, but need to clear up one thing regarding the whole server/client setup.

I've written a small script that fetches files from the server. This script is run on the client, and I'm going to add it to a cron job. The script basically runs the rsync command, and everything seems to be working fine. So where does the rsync daemon (i.e. "server") come into the picture? Do I need the server to be running the rsync deamon, and set up the rsync server service?


Regards,
kenneho
 
Old 02-10-2009, 06:29 AM   #2
Matey
Member
 
Registered: Jan 2009
Posts: 108

Rep: Reputation: 17
Sorry I am not very experienced in Linux but I think rsync is just an executable file and I dont really think its a TSR sort of thing (damon)that stays in the background? If it was we would have an rsyncd (may be)?
I may be wrong, but I think rsync is a script that does several things simultaneously like copy, compare, updates files etc.
Hope some one can answer this correctly.
 
Old 02-10-2009, 11:27 AM   #3
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,148

Rep: Reputation: 236Reputation: 236Reputation: 236
Hi

No need for a service for that. Install rsync on both computers, then set up ssh key based authentication. When you can ssh from the client to the server without a password, you can use rsync between the computers in cron.

The rsync service, I think is used for public servers to mirrors. Ssh is safer and easier to set up.
 
Old 02-11-2009, 11:18 AM   #4
chitambira
Member
 
Registered: Oct 2008
Location: Fife
Distribution: RHEL, Centos
Posts: 373
Blog Entries: 1

Rep: Reputation: 49
On the server that you would keep your 'served' files, you can actually create an rsync server by just running the rsync as a daemon;
First you create an rsyncd.conf file with contents as below:

[repository_name]
path = /path/to/repo_dir
readonly = yes
uid = root
host allow = 10.0.0.0/16
comment = For rsync of any files/directories with repo_name
logfile = /some_dir/rsync.log


then run rsync as a daemon
# rsync --daemon --config=/path/to/configfile/rsyncd.conf

Then from the client machine, whether on the command line or within a script, you will need to run;
# rsync -av SERVERNAME::repository_name/path/to/file local_directory/
 
Old 02-13-2009, 04:47 AM   #5
kenneho
Member
 
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 655

Original Poster
Rep: Reputation: 40
Quote:
Originally Posted by chitambira View Post
On the server that you would keep your 'served' files, you can actually create an rsync server by just running the rsync as a daemon;
This is actually what I don't understand - why would you need a deamon (i.e. server) when the clients can simply run the rsync-utility themselves? Is the deamon really just an alternative to using rsync over SSH (typically using key based authentication)?
 
Old 02-13-2009, 05:23 AM   #6
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,443
Blog Entries: 6

Rep: Reputation: 51
True..
I have read a couple of journals and noone talks about rsync.conf file either.
 
Old 02-13-2009, 06:53 AM   #7
kenneho
Member
 
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 655

Original Poster
Rep: Reputation: 40
So is my last question true, the one with daemon being simply an alternative to SSH based rsync?
 
Old 02-13-2009, 07:33 AM   #8
chitambira
Member
 
Registered: Oct 2008
Location: Fife
Distribution: RHEL, Centos
Posts: 373
Blog Entries: 1

Rep: Reputation: 49
You surely have not exhausted your reading. Learning does not stop!!

Read the manual
# man rsyncd.conf

The concept of rsync daemon is to provide a persistent server (Mirror) for files from which you can pull copies, in your case requesting from either within other programs/scripts or at the commandline
The rsync daemon will fork and continue to run in the background. Each new connection will make rsync fork to handle that request
Thi is very necessary if you have files that you want be be syncronised (to be the same all the time) especially if the files are continually being modified on the source server.

Check following links
http://samba.org/rsync/documentation.html
http://www.raskas.be/blog/2007/12/21...n-init-script/
http://sunsite.dk/info/guides/rsync/...mirroring.html

Last edited by chitambira; 02-13-2009 at 07:39 AM.
 
Old 02-13-2009, 07:34 AM   #9
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,148

Rep: Reputation: 236Reputation: 236Reputation: 236
Yes you are right. But it is used for different things. A lot of public FTP servers use the rsync daemon. Then mirrors and users can use rsync instead of FTP to save bandwidth.

I really hope there is no such a thing as anonymous ssh.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Server and Client process using Openssl: Error: no client certificate available lokesh_c2004 Linux - Security 2 11-10-2008 08:30 AM
Rsync server vs rsync over ssh humbletech99 Linux - Networking 1 10-18-2006 12:10 PM
Kubuntu package for GUI rsync client? Optiker Linux - Software 1 02-04-2006 02:45 PM
can not connect to my pureftp server from Linux client, but i can from windows client bonito Suse/Novell 5 03-16-2005 09:45 PM
Refresh client user list at autentication client/server network. robertoneto123 Linux - Networking 0 11-11-2003 10:38 AM


All times are GMT -5. The time now is 11:24 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration