Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

system(), exec(), fork() or sudo 3

Status
Not open for further replies.

1DMF

Programmer
Joined
Jan 18, 2005
Messages
8,795
Location
GB
I've been researching the possibility of running another script from within a script, and needing admin credentials for the second script/process

i've found a few methods... system(), exec(), fork(), but am unsure of the user account these commands run as, i'm assuming it's the same user account as the parent calling script. (IUSR)

I have then found a module on CPAN 'Sudo', which enables you to execute another command as a different user.

is this the way to go? do any of the other methods enable 'execute as different user' and what are the security issues?

any advice on the best way to go is appreciated.

PaulTEG has suggested that the first script could create a file, I then set up a scheduled task to run the second script at a given time which can process the created file data.

would this be the best and safest approach?

thanks 1DMF

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Works an absolute treat!

You were quite right MrCBofBcinTX , the script waits to get a lock on the file.

I'm well chuffed with the result, but then again, I am easily pleased :-)

thanks for everyones input on this, it really is appreciated.

Regards,
1DMF.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top