- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Creating Script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2007 04:07 AM
11-20-2007 04:07 AM
When I run these commands I have no problems. How can I dump them in a script to call them from cron?
Any help would be great!
Thanks
export JAVA_HOME=/opt/java1.5
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:/web/www/tomcat/webapps/is/WEB-INF/classes
export CLASSPATH=$CLASSPATH:/web/www/tomcat/webapps/is/WEB-INF/lib/classes12_g.jar
export CLASSPATH=$CLASSPATH:/web/www/tomcat/webapps/is/WEB-INF/lib/classes111_g.jar
export CLASSPATH=$CLASSPATH:/web/www/tomcat/webapps/is/WEB-INF/lib/classes12dms_g.jar
export CLASSPATH=$CLASSPATH:/web/www/tomcat/webapps/is/WEB-INF/lib/ojdbc14_g.jar
export CLASSPATH=$CLASSPATH:/web/www/tomcat/webapps/is/WEB-INF/lib/mail.jar
export CLASSPATH=$CLASSPATH:/web/www/tomcat/webapps/is/WEB-INF/lib/activation.jar
java schedule.email862
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2007 04:23 AM
11-20-2007 04:23 AM
Solution#/usr/bin/sh
export JAVA_HOME=/opt/java1.5
...
java schedule.email862
You can simply this:
export CLASSPATH=${CLASSPATH}:/web/www/tomcat/webapps/is/WEB-INF/classes:web/www/tomcat/webapps/is/WEB-INF/lib/classes12_g.jar
...etc. That is, by writing your CLASSPATH as one large, colon-delimited string.
If you want to simply place these export decleartions in a file by themselves that you can read (source) and reuse, do:
# cat ./myenvs
#!/usr/bin/sh
export JAVA_HOME=/opt/java1.5
export PATH=$PATH:$JAVA_HOME/bin
...
Then, 'source' or read this file into your environment by typing a dot ('.'), a space and the name of the file:
# . ./myenvs
This allows you to run your executable like:
# . ./myenvs java schedule.email862
If you are 'cron'ing your tasks, be sure to use absolute paths.
Regards!
...JRF...
- Tags:
- source
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2007 07:01 AM
11-20-2007 07:01 AM
Re: Creating Script
I have created this file
#!/usr/bin/sh
export JAVA_HOME=/opt/java1.5
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:/web/www/tomcat/webapps/is/WEB-INF/classes
export CLASSPATH=$CLASSPATH:/web/www/tomcat/webapps/is/WEB-INF/lib/classes12_g.j
ar
export CLASSPATH=$CLASSPATH:/web/www/tomcat/webapps/is/WEB-INF/lib/classes111_g.
jar
export CLASSPATH=$CLASSPATH:/web/www/tomcat/webapps/is/WEB-INF/lib/classes12dms_
g.jar
export CLASSPATH=$CLASSPATH:/web/www/tomcat/webapps/is/WEB-INF/lib/ojdbc14_g.jar
export CLASSPATH=$CLASSPATH:/web/www/tomcat/webapps/is/WEB-INF/lib/mail.jar
export CLASSPATH=$CLASSPATH:/web/www/tomcat/webapps/is/WEB-INF/lib/activation.ja
r
When I then try it
# . ./environment java schedule.email862
[root:demoglo:/web/www/fpwebscripts]
#
It just goes right back to a prompt. When I run it manually I get
# java schedule.email862
Generating ASSY Email
file ASSY saved
File ASSY.csv saved succesfully.
Generating CIVIC Email
file CIVIC saved
etc......
Any more tips?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2007 07:32 AM
11-20-2007 07:32 AM
Re: Creating Script
This works
. ./environment | java schedule.email862
So I think I'll be ok, do you have any idea though?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2007 07:47 AM
11-20-2007 07:47 AM
Re: Creating Script
I'm sorry, I meant to add a semicolon:
# . ./myenvs; java schedule.email862
Regards!
...JRF...