If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > chown a root file in a script

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-15-03, 16:10
markco1 markco1 is offline
Registered User
 
Join Date: Feb 2003
Posts: 6
chown a root file in a script

We have a log file that always gets created as root:other and to clear this log I have to su - root to change the permissions. I attempted to create a quick script so that a user would not have to su - root.
Just a simple
#!/bin/sh
chown mark:dev /export/home/test

I figured if I set it as 755 I would be able to run it as any user to modify the test file. No can do I receive the old
chown: /export/home/test: Not owner

Does any one know of a way to do this?

Thanks
MC
Reply With Quote
  #2 (permalink)  
Old 12-15-03, 18:28
fla5do fla5do is offline
Registered User
 
Join Date: Oct 2003
Location: Germany
Posts: 138
quick and dirty solution :

make an entry in root crontab with following row:

* * * * * chmod 755 /export/home/test
__________________
Greetings from germany
Peter F.

Last edited by fla5do; 12-15-03 at 18:33.
Reply With Quote
  #3 (permalink)  
Old 12-15-03, 19:24
skrishnaswamy skrishnaswamy is offline
Registered User
 
Join Date: Sep 2003
Posts: 7
why cant you use SetUID ?
Reply With Quote
  #4 (permalink)  
Old 12-16-03, 09:48
markco1 markco1 is offline
Registered User
 
Join Date: Feb 2003
Posts: 6
Thumbs up

Quote:
Originally posted by skrishnaswamy
why cant you use SetUID ?
Iknew there was a way, exactly what I was looking for.
Thanks
MC
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On