The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


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 !!

More UNIX and Linux Forum Topics You Might Find Helpful
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

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-17-2002
Registered User
 

Join Date: Jun 2002
Location: Illinois
Posts: 3
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  
Old 06-18-2002
Registered User
 

Join Date: May 2002
Posts: 8
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  
Old 06-24-2002
Registered User
 

Join Date: Jun 2002
Location: Illinois
Posts: 3
Unhappy rm Permission Denied error

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  
Old 06-24-2002
Kelam_Magnus's Avatar
Registered User
 

Join Date: Aug 2001
Location: DFW McKinney, TX,
Posts: 1,069
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  
Old 06-24-2002
Registered User
 

Join Date: May 2002
Posts: 8
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  
Old 06-25-2002
Registered User
 

Join Date: Nov 2001
Location: New Zealand
Posts: 333
Does this involve cron at all?
__________________
Pete
  #7  
Old 06-26-2002
Registered User
 

Join Date: Jun 2002
Location: Illinois
Posts: 3
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
Closed Thread

Tags
mtime

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 07:28 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0