I have several directories under an upload directory where differnt users upload their files (with exxactly the same file name every week) using their own user ids.
There is a requirement that once any user uploads the file I have to clean that file and remove extra whitespaces and unreadable characters.
I have a cleanup script which runs under an admin user (basically a group owner user say xyz) account which has access to all these directories.
Once I do the clean up the owner of the uploaded file gets changed to admin user and then next time when any user tries to upload their file again they get permission denied error as the file with same name exist with different owner.
Question is
1. How to give access to the individual user to over write the file own by the admin user or
2. How not to change the owner of the file to the admin user while cleaning up the file.
Note: All the users are part of the same group whose owner is the admin user mentioned above. i.e. in the /etc/group file all the user ids who uploads the file are listed under the group id
my cleanup script runs as user xyz and the ownership gets changed to xyz and then the userid1, userid2 and userid3 are not able to upload their files.
the owner of the upload directory is userid1
before upload
HTML Code:
abc.csv 100 5/21/2011 rw_r__r__ userid1
after upload and clean up
HTML Code:
abc.csv 100 5/21/2011 rw_r__r__ xyz
Next time when user userid1 tries to upload gets permission denied error.
Hope I am not confusing here.
Last edited by vbhonde11; 05-31-2011 at 07:50 PM..
Reason: added example
With a permissions problem like this, please show the output from "ls -lad" for each relevant file and parent directory. A weird edited output is not exactly useful because we cannot determine which field is the user and which is the group. Where does "100" come from I wonder? Is "xyz" both the name of a group and the name of a user in group "100"? Hard to guess.
First impression is to record the owner and group of the file before editing each file, then issue "chmod owner:group filename" after editing and set the permissions to something like 775.
Now we are clear that "xyz" is both the name of a username and the name of a group the fog is clearing.
Make USER "xyz" a member of group "xyz". i.e. Add "xyz" to group "xyz" (albeit as the usr "xyz"'s secondary group).
Then open the permissions on each relevant file to the group.
I want to change the ownership of a directory ONLY.
my id
id1 owns the files under the /mypath/bin
but /mypath/bin is owned by id2
If i log into id2
I can't do
chown id1 /mypath/bin (1 Reply)
Hi Friends,
I am using RHEL5.3 64bit. I have a data filesystem on this, which have lot of files copied from another server. I cannot see correct owner and group displayed for these servers. It shows 113 for owner and 755 for group. Anybody please tell me why it is?
Regards,
Arumon (1 Reply)
Hi,
I understand the permissions of a file/directory.
I just needs to understand how ownership works. Can some one help me on this please?
Thanks in advance. (6 Replies)
i have a directory in which i have Multiple files:
Following are they====
-rw-r--r-- 1 root root 886 Jan 21 16:38 trunkn.xsd
-rw-r--r-- 1 root root 244 Jan 21 16:38 trunknameCache.xml
-rw-r--r-- 1 root root 1240 Jan 21 16:38 subscribercache.xsd
-rw-r--r-- 1 root ... (1 Reply)
Hello all,
I have a script that runs on both the test and production box. The script is owned by a user (abcd for example) with permission set to 700. When this script is run as a root, the log file generated has owner and group as abcdowner and abcdgroup respectively.
Now, when I run the same... (4 Replies)
Good afternoon,
Sir's, i owuld like to search for some advice, whats the fastest way to change multiple files ownership. For HostnameA will be their basis, for what ever files and permissions that hostnameA has, it should replicate the permissions and ownership to hostname B.
$hostname... (1 Reply)
sm860 IS the owner of the files below,but yet sm860 cannot change the ownership to bpt3a1.Please let me know why ?
See below for details
---
sm860@unixs741_DEV:/usr/gdp/home/ftp/bpt3a1/incoming/ahdb/T5/pcasav/daily $ ls -l pcasav*
-rw-r--r-- 1 sm860 gdpintegrators 821 Sep 21 16:15... (8 Replies)
Hi,
I have newly installed sun solaris on my pc since I would like to learn something more about unix. During the installation, I had to assign a password for the super user root.After the installation, the book I am following suggested me to create a new user which I did. My home directory is... (1 Reply)