Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 01-10-2013, 10:53 PM   #1
LQ Newbie
Registered: Dec 2010
Distribution: Debian Testing, Centos 7
Posts: 12

Rep: Reputation: 0
Rsync Directory Replication

I'm trying to synchronize two directories on two separate server and haven't found many good ways to do it. I've concluded that rsync and cron is the best way. I synchronize the shares and then use Samba as a way to access the shares from windows machines. My question is... if I syncronize the owner and group and permissions over, will anything go wrong. I've never understood how that works with UIDs and all
Old 01-11-2013, 01:49 AM   #2
LQ Guru
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,777

Rep: Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888
you would need to explain what is that anything which went wrong. We cannot fix anything. What did you make and what was the error message you got?

Last edited by pan64; 01-11-2013 at 01:50 AM.
Old 01-11-2013, 02:12 AM   #3
LQ Newbie
Registered: Dec 2010
Distribution: Debian Testing, Centos 7
Posts: 12

Original Poster
Rep: Reputation: 0
I havent done anything yet. I'm asking if I do set this up, will I have troubles. I read that keeping the ownership and permissions on the files can mess things up if the UIDs don't match. Is this the case.

Last edited by doublez13; 01-11-2013 at 02:13 AM.
Old 01-11-2013, 02:15 AM   #4
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Linux Mint
Posts: 865

Rep: Reputation: 119Reputation: 119
I think the OP is asking of something is likely to go wrong. The answer is "yes."

You can find the UIDs of your users with the following command:
less /etc/passwd
Find the lines with your users at the beginning (the rest are system "users" that don't log in so much as own and manage stuff) and note the number after the second colon. Mine looks like this for my users:

dane:x:1000:1000:Dane Mutters,,,:/home/dane:/bin/bash
root should always be user "0", but other users will have different numbers, depending on what the system assigned to them. On some distros the first non-root user always gets UID 1000; others is 500; others are different, still. Even from one PC to the next (with same distro), it can differ somewhat.

The problem is making the UIDs from one PC match those on another so that you can access them from the other PC. Alternatively, you can use a chown or find/chown command to change the UID or user (that is, by name or by number) to one on the other system--either as part of the backup process or as part of accessing the data. I don't recommend using chmod, since this will basically defeat the purpose of keeping the user the same (by setting all the permissions to rwx or some such).

You should look into how rsync deals with user preservation--whether by name or UID. Also look into "--owner", "--group", "--super", "--fake-super", and any others you find in rsync.

Hope that helps.



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
Single-Master Replication steps for RedHat Directory Server 8.2 wisemind85 Red Hat 0 05-07-2012 02:50 AM
LXer: Data Replication Using rsync LXer Syndicated Linux News 0 11-11-2010 02:10 AM
How to directory replication between 2 or more servers? Winanjaya Linux - Networking 1 05-07-2010 01:25 AM
Replication between Linux OpenLDAP and Windows Active Directory spyghost Linux - Server 0 05-03-2007 03:10 AM
rsync no such file or directory (2) baronsam Linux - General 6 06-01-2006 07:13 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:47 AM.

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