The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > SUN Solaris
Google UNIX.COM


SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems .

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
cronjob inside the script namishtiwari Shell Programming and Scripting 3 02-04-2008 05:35 AM
HOw do i give a user cronjob edit/settings permission? debu UNIX for Advanced & Expert Users 2 01-24-2008 02:44 AM
help help cronjob problem with script bucci Shell Programming and Scripting 4 02-10-2007 01:38 AM
cronjob dies when user password expires sparcguy SUN Solaris 4 02-05-2007 12:04 AM
switch user inside a script nimo Shell Programming and Scripting 2 11-04-2005 04:51 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #8  
Old 12-15-2007
Registered User
 

Join Date: Dec 2007
Posts: 5
Hi Thanks.

Will running the script under root resolve the problem?

Regards,
csg_user.
Reply With Quote
Forum Sponsor
  #9  
Old 12-15-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
I would try and avoid stuff as root.

Can you describe step by step what your script does?
Reply With Quote
  #10  
Old 12-15-2007
Registered User
 

Join Date: Dec 2007
Posts: 5
The script(script1) will recycle our application services. This script could only be executed as the application user . So, We run this script manually by sudo su - appl_user , then password , then run the script . $myscript name. Now , iam trying to automate it . So, iam calling in a cronjob .But, that is not working .

Actually, based on this result, i need to create another script(script2) which will call the script1 only if some application conditions are satisfied.
That is where the sudo/password for the appl_user is creating problems.

Please help .Many thanks in advance.
Reply With Quote
  #11  
Old 12-15-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Confirm that script works from home directory of user you want it to run as when run from a terminal/ssh/telnet login.

That will prove if the user has all the rights etc.

Then do a "set" to print all the environment variables that are present before the script was run. Look through them and identify ones your script will need.

When the cron task runs assume none of those variables will be set (except a few, eg HOME).

As I said, 99% of cron problems are environment based.
Reply With Quote
  #12  
Old 12-15-2007
Read Only
 

Join Date: Nov 2007
Posts: 165
This is the sort of thing that can be run rom root's cron:

Code:
0,15,30,45 * * * * su - myuser -c /opt/myfolder/myscriptname
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:29 AM.


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