shell-init: could not get current directory: getcwd: cannot access parent directories

Hello

 
 
root@ne-ocadev-1:/root/scripts>su espos -c find /a35vol100/ESPOS/oracle/db/9.2.0/oradata/ESPOS/archive -type f -atime +10 -exec ls {}
 
shell-init: could not get current directory: getcwd: cannot access parent directories: Permission denied
 
find: insufficient number of arguments
find: path-list predicate-list
 
root@ne-ocadev-1:/root/scripts>su espos -c find /a35vol100/ESPOS/oracle/arc -type f -atime +10 -exec ls {}
 
shell-init: could not get current directory: getcwd: cannot access parent directories: Permission denied
find: insufficient number of arguments
find: path-list predicate-list
 
root@ne-ocadev-1:/root/scripts>id
uid=0(root) gid=1(other)
 
root@ne-ocadev-1:/root/scripts>su espos -c find /ESPOS/oracle/arc -type f -atime +10 -exec ls {};
 
shell-init: could not get current directory: getcwd: cannot access parent directories: Permission denied
find: insufficient number of arguments
find: path-list predicate-list
 
root@ne-ocadev-1:/root/scripts>id
uid=0(root) gid=1(other)
 
root@ne-ocadev-1:/root/scripts>su - espos
Sun Microsystems Inc. SunOS 5.9 Generic May 2002
You have new mail.
 
ne-ocadev-1(on ) DB:ESPOS User:espos
/ESPOS/oracle/db/9.2.0> cd ..
ne-ocadev-1(on ) DB:ESPOS User:espos
/ESPOS/oracle/db> cd ..
ne-ocadev-1(on ) DB:ESPOS User:espos
/ESPOS/oracle> cd arc/
ne-ocadev-1(on ) DB:ESPOS User:espos
 
/ESPOS/oracle/arc> ls -lrt | wc -l
885
 
ne-ocadev-1(on ) DB:ESPOS User:espos
/ESPOS/oracle/arc> pwd
/ESPOS/oracle/arc
ne-ocadev-1(on ) DB:ESPOS User:espos
/ESPOS/oracle/arc> su - root
Password:
Sun Microsystems Inc. SunOS 5.9 Generic May 2002
 
root@ne-ocadev-1:/root>su espos -c find //ESPOS/oracle/arc -type f -atime +10 -exec ls {}
shell-init: could not get current directory: getcwd: cannot access parent directories: Permission denied
find: insufficient number of arguments
find: path-list predicate-list
 

Please help for this issue.

Is this an intermittent problem?

Thanks for your support.

I'm not sure thsis intermittent problem.

but if i connect 'Espos' user i can able to read all file but throw root user i can't do any thing.

I need to give any permission?

Babu

What are the special priviledges for the Epos user under the profile? What shell is it using by default? By right, root should be able to do anything, but in your circumstances, I would rather take thru the step by step troubleshooting step to see "what root is missing" .. :slight_smile:

Is /root/scripts NFS mounted ?

looking at the command... shouldn't you fail to complete the command? you need `.... -exec ls {} \;` or `... -exec ls {} +`

Mmmmm, may be you cannot access parent directories by user espos ? :slight_smile:
Likely you have not rigth to read or exec on this dir.check it:
pwd
ls -la

if it looks like this
drwx------
you can't read this directory by another user (only root or master of dir)
When you write 'su espos' you will get only effective id of user espos, you stay in directory where you are (but user espos cannot read in this dir)

I guess you need test this
su - espos -c 'find /ESPOS/oracle/arc -type f -atime +10 -exec ls {} \;'

su 'dash' user