Find who has permission to delete


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Find who has permission to delete
# 1  
Old 12-24-2007
Find who has permission to delete

All,

I am running a script , which has permision as below

-r-xr-x--- 1 pmgr ffw 11660 Sep 3 2003 ccln

and tring to delete the file in the directory inter

(sys212Smiliect:/>) ll | grep ^d

dr-xr-xr-x 32 bin bin 8192 Dec 24 03:24 etc
drwxr-xr-x 32 root root 1024 Nov 27 16:45 home
drwxrwsr-x 3 inter inter 10240 Dec 21 15:03 inter

(sys212Smiliect:/>) cd inter
(sys22Smiliect:/inter>) ll | head
-rw-r----- 1 int01 inter 11055 Jul 5 2006 06187.txt
-rw-r----- 1 int01 inter 9380 Jul 6 2006 06188.txt
-rw-r----- 1 int01 inter 24388 Jul 7 2006 06189.txt

How can i know that whether my script ccln is having permision to delete the files inside the directory . Please let me know how to find out
-r-xr-x--- 1 pmgr ffw 11660 Sep 3 2003 ccln
what are the operation the ccln can perform .

Inside ccln i am find the file and deleting the file . It is not working for directory inter that i mentioed above . Can any one let me know why an d how cani overcome the same

Thanks,
Arun
# 2  
Old 12-24-2007
Also i facing the below problem as well.

In my directory i am having many files and subdirectories. my directory is like below
drwxrwxr-x 5 root canusr 8192 Dec 5 12:50 tran

others dont have write permision

in side my directory the files i am having are
$cd tran
drwxr-xr-x 2 v1ftp cnur 8192 May 1 2007 v1ftp
drwxrwxrwx 3 v1ftp cnur 24576 Dec 24 06:00 v1
drwxrwxrwx 2 ham cnur 8192 Nov 6 09:28 itm
-rwxrwxrwx 1 scott cnur 1006258 Sep 19 15:33 7041012_cpy
-rwxrwxrwx 1 scott cnur 72928579 May 1 2007 uswst.gz

My question is :

When i use find and delete to delete the files that are 30 days old why the files 7041012_cpy and uswst.gz are not getting deleted .

Also the same find and delete command is deleting the file that 30 days old inside the dir v1

My Assumptions

Is that my directory is not having write permision the files in the dir is not getting deleted.


if so the how come the same command working and deleting the file inside the sub_directory.

Thanks,
Arun
# 3  
Old 12-26-2007
MySQL

All,

I have found some thing please correct me if i am wrong

1. If a file Doesnt have write permision we cannot delete the file
2. If a directory doesnt have write permision , We cannot delet eany files in sidethe directory.
3. If a directory doesnt have wrote permsion and its subdiretory has write permision we can delete the files inside the sub directory.

I am confused about this 3 rd point Even though the parent directory doesnt have write permision how unix allows the delete operation perform in it sub directory.

Thanks,
Arun
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help with using find for other permission

Hi, I am using the following find command to search for file permissions that I have to correct find . -perm 777 -type f -print find . -perm 777 -type d -print I then do a chmod o-w,o-r,o-x to make them not not 777. I am also needing to search for where the others has... (1 Reply)
Discussion started by: newbie_01
1 Replies

2. Shell Programming and Scripting

Is rsync --delete on some files without write permission possible?

Hello all, I have a problem with rsync command. From a backup server, I use a command like the one below: rsync -av --delete user@host:/home/user/ /home/backup_user/daily_rotating_backup/ In some folders of the user there are some files on which he has removed his write permission on... (3 Replies)
Discussion started by: freddie50
3 Replies

3. UNIX for Dummies Questions & Answers

How to find out who changed the file permission in unix

Can any one tell me is there any command to find out who changed the permission of a file Or is there any log file so that i can find out who has changed the permission of a file? Thanks in Advance:) (7 Replies)
Discussion started by: Uttamnsd
7 Replies

4. UNIX for Dummies Questions & Answers

Find - prints Permission denied

Hi, I'm trying to search for files with a particular pattern using the below command. find . -name file_1.txt -print It gives Permission denied error on several files, using standard error, how do we ignore this error and print only the valid matches. find:... (1 Reply)
Discussion started by: Dev_Dev
1 Replies

5. SuSE

Cannot delete no permission file

I am trying to delete a folder, but unable to do so. tried my level best to delete. Here I am giving all the steps I have tried out - 1. Output of ls -la ls: cannot access -loop0: Permission denied ls: cannot access -e0.7: Permission denied total 324 d????????? ? ? ? ? ? -e0.7 d????????? ?... (4 Replies)
Discussion started by: sudip.majumder
4 Replies

6. Solaris

Delete Permission on Directory

Hi, I have a directory /u01/source. Following are current permission on directory source. oracle@TEST # ls -l source drwxrwxrwx 2 user1 userbi 31232 Apr 8 13:33 EG1 drwxrwxrwx 2 user1 userbi 1024 Apr 8 05:45 E2 drwxrwxrwx 2 user1 userbi 57344 Mar 15 10:22 h5 There is another ... (4 Replies)
Discussion started by: fahdmirza
4 Replies

7. Fedora

Find Files in Directory by Permission?

Hello. I need to write a script that lets the user pick a directory. Then, all files are looped through, and the ones with read-write (for current user I think) are listed. Ending with a count of those files, but that parts easy. What I'm confused about is the middle. So far I have ... (15 Replies)
Discussion started by: Feuyaer
15 Replies

8. Post Here to Contact Site Administrators and Moderators

shouldnt we also have the permission to delete our threads

i think we should also have the permissions to delete our own thread (3 Replies)
Discussion started by: tarunicon
3 Replies

9. Shell Programming and Scripting

Find File with permission below 664

Hi Using find i want to find files with permission below 664. (6 Replies)
Discussion started by: aliahsan81
6 Replies

10. UNIX for Dummies Questions & Answers

unable to delete file for permission problem

Hi, We are facing problem to delete some logfiles. Explaing with example for clear understanding : we have 2 accounts : prdpqrs (application account) & prodxyz (admin account - not root). Both of them are in same group called 'release' While prodxyz is trying to remove a file owned by... (4 Replies)
Discussion started by: sabyasm
4 Replies
Login or Register to Ask a Question