LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 01-10-2013, 09:53 PM   #1
doublez13
LQ Newbie
 
Registered: Dec 2010
Distribution: Ubuntu, Ubuntu Server
Posts: 8

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, 12:49 AM   #2
pan64
Senior Member
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 4,645

Rep: Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250Reputation: 1250
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 12:50 AM.
 
Old 01-11-2013, 01:12 AM   #3
doublez13
LQ Newbie
 
Registered: Dec 2010
Distribution: Ubuntu, Ubuntu Server
Posts: 8

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 01:13 AM.
 
Old 01-11-2013, 01:15 AM   #4
DaneM
Member
 
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Linux Mint
Posts: 727

Rep: Reputation: 75
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:
Code:
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:

Code:
root:x:0:0:root:/root:/bin/bash
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.

--Dane
 
  


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


All times are GMT -5. The time now is 03:43 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