This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes BEA/Weblogic and the fly likes crontab for application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "crontab for application" Watch "crontab for application" New topic
Author

crontab for application

alireza seighalani
Greenhorn

Joined: Sep 24, 2012
Posts: 7
hi everyone

i want to stop or start an application in a specified time in weblogic 9.2.0.1 by cronjob . how can i run it? thanks in advance
alireza seighalani
Greenhorn

Joined: Sep 24, 2012
Posts: 7
my problem solved:

you shoud put start and stop scripts in /opt/bea/weblogic92/common/bin:

startapp.py

"""
Sample script demonstrating usage of WLSTHome directory where users
can add commands to wlst namespace. This script is executed when WLST is first invoked, and
all functions defined in this module will be available to wlst out of the box.
If user would like to specify another directory they could very well do so
by specifying -Dweblogic.wlstHome=<another-directory>.
Please make sure that any commands you add do not collide with commands already
defined by WLST.
@author Satya Ghattu
Copyright (c) 2004 by BEA Systems, Inc. All Rights Reserved.
"""
username = 'weblogic'
password = 'weblogic-password'
url = 't3://10.1.20.33:7001'



## Connect to the AdminServer

try:
connect(username, password,url)
except:
connect(username, password,url)

progress=startApplication('application-name');
disconnect();

exit()



stopapp.py:

"""
Sample script demonstrating usage of WLSTHome directory where users
can add commands to wlst namespace. This script is executed when WLST is first invoked, and
all functions defined in this module will be available to wlst out of the box.
If user would like to specify another directory they could very well do so
by specifying -Dweblogic.wlstHome=<another-directory>.
Please make sure that any commands you add do not collide with commands already
defined by WLST.
@author Satya Ghattu
Copyright (c) 2004 by BEA Systems, Inc. All Rights Reserved.
"""
username = 'weblogic'
password = 'weblogic-password'
url = 't3://10.1.20.33:7001'



## Connect to the AdminServer

try:
connect(username, password,url)
except:
connect(username, password,url)

progress=stopApplication('application-name');
disconnect();

exit()
 
 
subject: crontab for application