| Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
02-10-2009, 04:53 AM
|
#1
|
|
Member
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 652
Rep:
|
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
|
|
|
|
02-10-2009, 06:29 AM
|
#2
|
|
Member
Registered: Jan 2009
Posts: 107
Rep:
|
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.
|
|
|
|
02-10-2009, 11:27 AM
|
#3
|
|
Senior Member
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,007
Rep: 
|
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.
|
|
|
|
02-11-2009, 11:18 AM
|
#4
|
|
Member
Registered: Oct 2008
Location: Fife
Distribution: RHEL, Centos
Posts: 373
Rep:
|
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/
|
|
|
|
02-13-2009, 04:47 AM
|
#5
|
|
Member
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 652
Original Poster
Rep:
|
Quote:
Originally Posted by chitambira
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)?
|
|
|
|
02-13-2009, 05:23 AM
|
#6
|
|
Senior Member
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,411
Rep:
|
True..
I have read a couple of journals and noone talks about rsync.conf file either.
|
|
|
|
02-13-2009, 06:53 AM
|
#7
|
|
Member
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 652
Original Poster
Rep:
|
So is my last question true, the one with daemon being simply an alternative to SSH based rsync?
|
|
|
|
02-13-2009, 07:33 AM
|
#8
|
|
Member
Registered: Oct 2008
Location: Fife
Distribution: RHEL, Centos
Posts: 373
Rep:
|
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.
|
|
|
|
02-13-2009, 07:34 AM
|
#9
|
|
Senior Member
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,007
Rep: 
|
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.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:49 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|