LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-05-2005, 09:11 AM   #1
VorlonInfoTech
Member
 
Registered: Jun 2003
Location: West Grove, PA
Distribution: Gentoo, Debian, SuSE, Mandrake
Posts: 55

Rep: Reputation: 15
rsync Does Not Preserver File Ownership


I'm setting up rsync to backup my files to a separate computer every night. I've found some very good docs which have made the process very simple to setup and use.

I have 1 problem howerver: My backups all have the ownership of the rsync process instead of the original owner.

I have a cron job which runs rsync as the user "archiver", and copies files from the "/home" directories onto the backup disk. When I look at the files on the backup disk, I find that the owner and group of these files are all set to "archiver", NOT the original owners.

I am using the rsync "--archive" flag, and also explicitly setting both the "--owner" and "--group" flags (to no effect).

I had to set the backup directory to allow the user "archiver" to be able to write to the directory, so I suspect I've got a permissions problem inherent in my Debian system.

Can anyone suggest a possible solution or area for investigation?
 
Old 03-05-2005, 09:23 AM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
I think it will only work if the root user runs the backup or you sudo the rsync command.
 
Old 03-05-2005, 10:09 AM   #3
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
rsync process uid? What is the exact command your using to back these files up to your other computer and the user one computer A, does their uid match the same user on computer B?
 
Old 03-07-2005, 04:52 PM   #4
VorlonInfoTech
Member
 
Registered: Jun 2003
Location: West Grove, PA
Distribution: Gentoo, Debian, SuSE, Mandrake
Posts: 55

Original Poster
Rep: Reputation: 15
I'm using the following command from crontab on the local computer which stores the backup files.

45 02 * * * archiver rsync --archive --backup --suffix="-PreviousCopyFrom-"`date +%Y-%m-%d` --exclude="*PreviousCopyFrom*" --copy-links --max-delete=25 --delete --delete-after --timeout=30 --progress --bwlimit=100 Server1.mydomain.com:/home /data1/Server1/home


the user archiver is common on both computers, and I have exchanged the "authorized keys" files so no passwords have to be exchanged. Obviously, I dont want to pass along authorized keys for the root user on both computers.
 
Old 10-20-2005, 11:19 AM   #5
flgal3
LQ Newbie
 
Registered: Aug 2005
Distribution: RedHat Enterprise WS v.3
Posts: 27

Rep: Reputation: 15
Resolution?

Just curious, what did you ultimately do here? Were you ever able to get rsync to run as a non-root user *and* maintain the original owner of the copied files?

Thanks.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
File Ownership chrisfirestar Linux - General 2 11-10-2005 04:41 AM
file ownership dar28ek Linux - General 4 07-08-2005 08:43 AM
Apache File Ownership wenberg Linux - Software 2 04-02-2004 09:39 PM
CVS - file permissions and file ownership Osten Linux - Software 3 01-18-2004 04:08 PM
Samba changes file ownership hansen Linux - Networking 4 12-01-2003 12:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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