LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 10-05-2023, 06:06 AM   #1
hacktheworld
LQ Newbie
 
Registered: Oct 2023
Posts: 1

Rep: Reputation: 0
Preserve ownership and file permissions on CIFS Share


Hi guys,

I'm dealing with a problem with a CIFS share and a rsync process.
CIFS is mounted in fstab:

//server/backup /backup cifs iocharset=utf8,rw,credentials=/etc/backup-credentials.txt,uid=1000,gid=1000,file_mode=0660,dir_mode=0770,user_xattr 0 0

Rsync command I launch is:

rsync -avp --delete /home/lab /backup

All user files under /home/user are owned by lab user but files in /backup are owned by uid=1000 and gid=1000 as defined in fstab.

I want to preserve ownership.
May be possible?

Thank you very much
 
Old 10-05-2023, 11:54 PM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,041

Rep: Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347
yes, possible, but you need to use different mount options. It is now forced to use uid=1000 and gid=1000.
 
  


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
[SOLVED] How to copy to preserve original permissions and ownership after crash StepNjump Linux - Laptop and Netbook 3 03-17-2016 03:51 PM
NAS over CIFS on an old Fedora Core distro does not preserve file ownership on copy nurikabe Linux - Newbie 12 04-09-2009 03:09 PM
preserve file ownership with the "zip" command? zovres Linux - General 2 11-25-2004 09:01 PM
Preserve file permissions when copying from NTFS to a Samba share? somedude Linux - Software 4 06-11-2004 09:20 AM
Why doesn't "cp -p <file>" copy <file> and preserve ownership? davidas Linux - Newbie 5 04-12-2004 05:44 AM

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

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