![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ssh permission denied | gefa | AIX | 3 | 11 Hours Ago 07:52 AM |
| permission denied error | Anji | Shell Programming and Scripting | 2 | 01-08-2008 03:34 AM |
| Need help with Couldn't canonicalise: Permission denied error | wilsontan | UNIX for Advanced & Expert Users | 8 | 02-06-2007 04:13 PM |
| xterm gives me permission denied error | kymberm | Shell Programming and Scripting | 1 | 09-02-2004 03:10 AM |
| getcwd: permission denied error | Deepa | UNIX for Advanced & Expert Users | 3 | 02-10-2003 06:16 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
rm Permission Denied error
I am very new to Unix. We have a script that will remove files from a directory. The account removing the files has the same permissions as the directory the files are located. We have logged in as the account and deleted the files from that directory but when we run the script with the account it comes up with permissions denied.
This is what they have in the script to remove files. eval find $LOG_DIR -mtime +$LOG_DAYS -name \'$LOG_FILE\' -exec rm {} \\\; Any ideas? I do not know where to look next. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Hai Cech2002 ,
To allow executing both 'find' & 'rm' on a particular directory permissions 'rwx' is to be set to that user.Check out whether it's set or not ? Regards Gambhi. |
|
#3
|
|||
|
|||
|
Yes the account has the rwx permission. If we logon with the account it will delete the files but if done through the script it will not.
This is the line that is used to delete the files. eval find $LOG_DIR -mtime +$LOG_DAYS -name \'$LOG_FILE\' -exec rm {} \\\; |
|
#4
|
||||
|
||||
|
If you can execute the commands as this user, then use the su - command to login as that user. Then execute the commands as that user then exit.
Maybe that will help.
__________________
My brain is your brain |
|
#5
|
|||
|
|||
|
By the way have u check out whether that particular account has got the executable permission on that script file ?? (as the error is coming only when u run that script file not when running the same from command prompt)
Rgds |
|
#6
|
|||
|
|||
|
Does this involve cron at all?
__________________
Pete |
|
#7
|
|||
|
|||
|
No this is not using cron.
The ownership of the files is -rw-rw-r-- 1 infdvlpap other and I have a different account approd trying to remove these files. Does the infdvlpap account that owns the files and the approd account trying to remove the files have to have the same Group ID? id infdvlpap gid=1(other) groups=1(other). id approd gid=101(dba) groups=101(dba),1(other),201(appworx),301(prod) |
|||
| Google The UNIX and Linux Forums |