Change Dir doubt and some advice.


 
Thread Tools Search this Thread
Operating Systems Solaris Change Dir doubt and some advice.
# 1  
Old 06-28-2011
Change Dir doubt and some advice.

Hello,

This is my first post in this forum.

I need to change the owner of several directories and files in Solaris 10 Operating system, more than 500.
The server is in production and my question is:
If i change the owner of directories and files, the server can become unstable, i mean, some services or processes can stop or donīt work properly? These change include any kind of directories and files in the server.
The owner of these directories will be root.

The advice is:
I already have a script to change the owner.
Code:
#!/bin/sh
OWNERR=root
while read direct; do
chown "$OWNERR" "$direct"
done < FileWithDir

############################
FileWithDir has the format:
Code:
/dir/dir/<file or dir>

Can someone advice any improvement in this script or that itīs not necessary.

Thanks,

Checo

Last edited by pludi; 06-28-2011 at 04:59 PM..
# 2  
Old 06-28-2011
Well, yes, different ownership can change access. The chown, chgrp and chmod all have a -r/-R option to do the change recursively down the sub-tree, btw. Read man chmod carefully. If a person lacks access bits as the right group or the right ID, they cannot get access from other bits.
Code:
(
 for d in $HEAD_DIRS
 do
  chown -R new_own $d &    # parallelism
 done
 
 wait
) # subshell so not to wait on any other children.

# 3  
Old 06-29-2011
Hello DGPicket,

thanks for your answer.
I known that different ownership can change access and i know that the chown, chgrp and chmod commands have -r/-R option. I cannot use the recursevily option due that
i know exactly which directories should be changed. Change the ownership for these directories/files it's not a problem as well because the ownership which i'm changing to
it's the correct ownership for these directories/files ( I have more equal servers with the same OS and these directories/files have the same owner as the one which i'm changing to.
The main point of my question was, being this server in production, processes and services running, this change will not affect the performance of the server or
have some impact in these services/processes, taking in account that they started as a different owner. Imagine that by mistake, these directories/files were configured
with the wrong owner and now i'm changing to the correct owner. I'm sure that, if the server is restarted, these services/processes will work perfectly with this owner.

Thanks,

Checo
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

[Solved] Unable to change/create home dir for particular user

Hi all I wanted to change the home dir for a user, but when using smh : SMH->Accounts for Users and Groups->Local Users->Modify User ---------------------------------------------------------------------------------------------------------------------------------------------- * Required... (8 Replies)
Discussion started by: fretagi
8 Replies

2. Shell Programming and Scripting

Generate a change list of files/dir

Is there a tool that can diff a directory and generate a change list of files in that directory based on a previous snapshot on the directory? For example /etc/a.txt:changed /etc/b.txt:removed /etc/c.txt:added Thanks! (1 Reply)
Discussion started by: overmindxp
1 Replies

3. HP-UX

could not able change permission of /home dir

Hi i am new to this admin area . i have created user with name as "ab" and gave home dir as /home/ab . when i tried to create the /home/ab dir , i got he following error. "mkdir: Failed to make directory "/home/ab"; Operation not applicable " Thanks in advance . (1 Reply)
Discussion started by: expert
1 Replies

4. Solaris

How to change permission for opt dir in Solaris Zones?

Hi All While configuring zone I run add inherit-pkg-dir I thing this command will inherit opt,etc,lib... directories from global zone to non global zone with read permission................ So this makes problem for me I want to edit one file opt dir which is useful for my project but when I... (4 Replies)
Discussion started by: vijaysachin
4 Replies

5. Solaris

Change inherit-pkg-dir to writable

/lib in my sparse zone is running and its inherit-pkg-dir due ti which its readonly is it possible to make it writable if yes how ? (2 Replies)
Discussion started by: fugitive
2 Replies

6. Solaris

cant able to change permission in a DIR as root user

Hi my directory not accepting any commands. its simply telling permission denied. i tried ( cp, mv, rm ) as roor i want to set default permissons to this DIR please find the Logs below. dr-xr-xr-x 1 root root 1 Jun 1 09:04 AP1_ROP ( original dir) root> chmod 777... (5 Replies)
Discussion started by: vijayq8
5 Replies

7. Shell Programming and Scripting

how I change dir in dos

Hi I have a dos batch file in window server where I call a cmd command for creating some db. this cmd commad is located in e:\data\abcd\xyz.cmd. Now I call this batch file from unix ssh.sh but my access point is D in window server here I want to change the dos prompt to e:\data\abcd. in... (3 Replies)
Discussion started by: Jamil Qadir
3 Replies

8. UNIX for Dummies Questions & Answers

Move A File With Same Date,don't Change The Desitination Dir Date

Assume, I created one file three years back and I like to move the file to some other directory with the old date (Creation date)? Is it possible? Explain? (1 Reply)
Discussion started by: jee.ku2
1 Replies

9. Shell Programming and Scripting

a script to clone a dir tree, & overwrite the dir struct elsewhere?

hi all, i'm looking for a bash or tcsh script that will clone an empty dir tree 'over' another tree ... specifically, i'd like to: (1) specify a src directory (2) list the directory tree/hiearchy beneath that src dir, w/o files -- just the dirs (3) clone that same, empty dir hierarchy to... (2 Replies)
Discussion started by: OpenMacNews
2 Replies

10. UNIX for Dummies Questions & Answers

change login dir

Ok when I log in to my terminal I land in a dir. How can I change the dir that I start from when I login? Thanks for the help, sure it is a no brainer for you guys cd (5 Replies)
Discussion started by: lorcet222
5 Replies
Login or Register to Ask a Question