LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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: 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, 12:49 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,837

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

Rep: Reputation: 130Reputation: 130
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:56 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration