Ownership changes


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Ownership changes
# 8  
Old 07-16-2015
Thank you for your reply. I don't have Cygwin installed on the Windows server. I only have Services for NFS. As for the rsync command, I don't want to preserve the permission at the source as it will overwrite the Windows destination permission.

Windows server 2008 Standard
  • On the domain
  • Has Services for NFS and acts as NFS server
  • NFS share on E drive (allow anonymous access unchecked). Permission have a list of IPs Read/Write ANSI encoding and Root Access Allowed)
  • Identity mapping points to our domain
Linux1
  • Acts as the NFS client
  • Mounts the Windows share
Linux2
  • Rsync data to Linux1 NFS mount causing ownership changes to a domain user account and wipes previous permissions to new ones on files and folders in Windows.
  • Each day, our fix is to change the ownership back to the Administrators group and go to the parent folder and inherit permissions to what was changed from the parent folder on Windows.
It is quite cumbersome to make the ownership changes and manually do the permission changes each day in order for clients to make changes to the Windows files.

I need to find a solution for rsync to make changes to the data while keeping the ownership (Administrators group) and permissions intact.

I'm not too sure how the mapping works but the domain is specified. I'm guessing the user used by Linux to mount and rsync points to a specific domain user. How it chooses the user in the domain I'm not sure. I've noticed that the Linux user (test) points to domain account which contains test (test DOMAIN\1_2_test). Perhaps Linux user maps to same name user in the domain(or has that same name in the userID). But that domain user seem to overwrite the ownership of the file and adds Full Control in the permission which I want to avoid.

I'm not supporting the 2 Linux boxes but I can find out if you need more information at that level.

Hope I've cleared it up a bit more.
lace0047

Last edited by Lace0047; 07-16-2015 at 01:23 PM..
# 9  
Old 07-16-2015
It appears that all that you need is the -r flag, which will copy data recursively if needed by do not preserve the original timestamp or permissions.
Code:
rsync -r

# 10  
Old 07-16-2015
We tried just -r but the problem remains. The ownership changed again to domain user and the permissions was wiped again.
# 11  
Old 07-16-2015
Can you loose the -p option, and try with following (taken from the rsync manual)
Code:
To give new files the destination-default permissions 
(while leaving existing files unchanged), 
make sure that the
--perms option is off 
and
use
--chmod=ugo=rwX (which ensures that all non-masked bits get enabled). # you can try without this...

Other then that -p option will do the following :
Code:
This option causes the receiving rsync to set the destination permissions to be the same as the source permissions

Which you obviously don't want.
# 12  
Old 07-17-2015
Thanks for your reply but we've tried that already but with no luck. It might be related to UID and GID mapping between the Linux user running the NFS mount, the rsync and Windows server. It might not be working properly.
# 13  
Old 07-20-2015
I have enabled the KeepInheritance under the ServerforNFS on the Windows server in the registry and waiting for test rsync.

The rsync command from what Peasant has suggested will be used. I will confirm once I get it tested.

---------- Post updated at 10:18 AM ---------- Previous update was at 09:58 AM ----------

I was thinking of scheduling the change of ownerships and permissions through a batch job on all affected files and folders daily but we have too many files and folders to perform this.

---------- Post updated at 03:11 PM ---------- Previous update was at 10:18 AM ----------

I just got word from our Linux support that --no-perm does not execute as the rsync version is too old. The version is 2.6.2. We will try upgrading our rsync version and we'll try again when the new rsync version will be implemented.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

retain ownership

Hi, I have a script which transfers files/directories from one HP unix to another HP unix server using SCP but i need to retain ownership of files/folders same as source server my script is as follows cd /sasdata/TR_CNTO328/C0328T07/Dry_Run_1/Macros find . -type d -newer . -exec scp -pr {}... (6 Replies)
Discussion started by: tushar_spatil
6 Replies

2. UNIX for Dummies Questions & Answers

regarding changing ownership and group

i am able to change the mode using chmod and able to change permission. but i am not able to change group and ownership. getting as invalid can any one help me regarding this . (4 Replies)
Discussion started by: satheeshkr_cse
4 Replies

3. Shell Programming and Scripting

Get ownership info from LS

Hi, When I do the ls-ld command for example like this: # ls -ld /Applications I get an output like this: drwxrwxr-x+ 114 root admin 3876 18 Aug 14:04 /Applications I need to somehow use sed to put the ownership into a format like this: root:admin So basically remove... (2 Replies)
Discussion started by: pcwiz
2 Replies

4. UNIX for Dummies Questions & Answers

Ownership question

Hi there, Complete Newbie here so any help would be so appreciated! :) I've set up a test directory and am trying to figure out out how to ensure that all new files will remain owned by the directory owner... not the creator of the file?? (3 Replies)
Discussion started by: CasperQuiet
3 Replies

5. UNIX for Dummies Questions & Answers

changing ownership?

how would i change ownership of file1 so the user NATE gets ownership of the file? (1 Reply)
Discussion started by: trob
1 Replies

6. Shell Programming and Scripting

Why the cp keeps the original ownership?

I want to copy a file from another user to my owner directory, and want to change the ownership to my account. in jung's directory: -rwxr-xr-x 1 jung smart 23 Dec 1 2005 .runme cp /home/jung/runme . under my directory: -rwxr-xr-x 1 jung smart 23 Dec 1... (1 Reply)
Discussion started by: freelong
1 Replies

7. UNIX for Dummies Questions & Answers

precompressing and ownership

I'm looking for a way to create preprocessed .gz files of static pages to serve up to those browsers that can accept them. I know I can use: gzip -c --best index.html > index.html.gz to create the .gz file _and_ keep the original. What's the proper command line way to run that on each... (2 Replies)
Discussion started by: dheian
2 Replies

8. Solaris

Filesystem ownership with zones

What I have" Solaris 10 U4, recently patched. ZFS filesystems on the global zone Local Zones on the zfs filesystems. If I make a new ZFS filesystem, and present it to a local zone, i.e. /u01. If I change the ownership of /u01 in the Local zone to oracle:dba /u01. The file becomes... (1 Reply)
Discussion started by: BG_JrAdmin
1 Replies

9. Shell Programming and Scripting

help regarding file ownership

hi friends,i have a doubt,if there is a file for which i have only read access then is there any way to execute it,plz reply soon (5 Replies)
Discussion started by: amit007
5 Replies

10. UNIX for Dummies Questions & Answers

ownership of files

Hi, While changing ownerships from the root on a server i'm managing, i typed chown -R username:users * and it changed all ownership to username. Can someone tell me if there is someway I can set things back the way they were before? I can't even su username from the root. Am I going to just... (4 Replies)
Discussion started by: szhu
4 Replies
Login or Register to Ask a Question