![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems . |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| cronjob inside the script | namishtiwari | Shell Programming and Scripting | 3 | 02-04-2008 04:35 AM |
| HOw do i give a user cronjob edit/settings permission? | debu | UNIX for Advanced & Expert Users | 2 | 01-24-2008 01:44 AM |
| help help cronjob problem with script | bucci | Shell Programming and Scripting | 4 | 02-10-2007 12:38 AM |
| cronjob dies when user password expires | sparcguy | SUN Solaris | 4 | 02-04-2007 11:04 PM |
| switch user inside a script | nimo | Shell Programming and Scripting | 2 | 11-04-2005 03:51 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
How to run a script as different user inside cronjob in solaris.
Hi ,
I have a shell script to perform some actions on sun solaris box . This script normally requires to be run as a different user. so, whenever i have to run this script, i need to sudo in as that user , enter the password and execute it. Now,I have to setup a cronjob to execute the script every 15 mins .I have provded 777 permissions for that script . But, that is not working inside the cronjob. I think the sudo is creating problems. Iam planning to create another script to call the original script .Is there a way to provide the password and the user id that i need to sudo in to run the script while running from a cronjob? Please advise how to handle this. Thanks &Regards, csg_user |
| Forum Sponsor | ||
|
|
|
|||
|
Hi Prowla,
Thanks for your reply . Quote:
My cron will have : 0,15,30,45 * * * * /opt/myfolder/myscriptname. I will use the same under root's cron .But,Where should i use the "su - user -c command". Please let me know. |
|
|||
|
I don't know, I don't know what your script does or how you've set it up, but 99% of problems with crontab are due to environment variables not being initialised.
|
|||
| Google UNIX.COM |