- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- running scripts in crontab
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
08-21-2001 03:00 AM
08-21-2001 03:00 AM
running scripts in crontab
I am trying to run a script in crontab - when I execute the script on a command line it will work not probelm but when I schedule it in the crontab it will not work!
I have included in the script to set the enviroment but still it will not work !!
Any suggestions
#!/usr/bin/sh
HOME="/apps/program/core_bin"
# A short wrapper script to set the TERM variable for ret.
# the curses front end to ret dies when TERM="".
TERM=hpterm
export TERM
program -c ret_alive_check.cmd > /dev/null
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2001 03:05 AM
08-21-2001 03:05 AM
Re: running scripts in crontab
It could be that you have to use the whole pathname.
What is the return code in /var/adm/cron/log ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2001 03:08 AM
08-21-2001 03:08 AM
Re: running scripts in crontab
jobs executed from the crontab have a very limited environment.
To solve your problem you can add the full path to "program", as Mark as already mentioned, or you could define your PATH in your script.
good luck,
Thierry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2001 03:18 AM
08-21-2001 03:18 AM
Re: running scripts in crontab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2001 03:33 AM
08-21-2001 03:33 AM
Re: running scripts in crontab
This has to do with the environment setting.
Include all the environment setting present in .profile in your script.
Also check the cron logs in /var/adm/cron
...BPK...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2001 05:58 AM
08-21-2001 05:58 AM
Re: running scripts in crontab
added line into crontab .. as so
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /apps/program/core_bin/ret -c /apps
/program/core_bin/alive1.sh
but still - it won't run for me !!
Help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2001 06:10 AM
08-21-2001 06:10 AM
Re: running scripts in crontab
/apps/program/core_bin/ret -c /apps/program/core_bin/alive1.sh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2001 06:10 AM
08-21-2001 06:10 AM
Re: running scripts in crontab
did you check the user's (root?) mail? Output from a cron job will be mail to the user, so you might find something usefull there.
How about "alive1.sh", this script might also need some environment variables like PATH, ...
regards,
Thierry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2001 06:39 AM
08-21-2001 06:39 AM
Re: running scripts in crontab
set TERM=hp and not to hpterm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2001 08:02 AM
08-21-2001 08:02 AM
Re: running scripts in crontab
0,5,10,15,20,25,30,35,40,45,50,55 * * * * * /apps/program/core_bin/ret-c /apps/program/core_bin/alive1.sh
this is now the script
#!/bin/sh -f
HOME=/home/program
PATH=/bin:/usr/sbin:/usr/bin:/sbin:/usr/bin/X11:/usr/local/bin:/usr/lbin:/usr/uc
b:/usr/lbin:/etc:/usr/lib:.:/oracle8/OraHome1/bin:/apps/program/core_bin:/apps/
program/aim_bin
LOGNAME=program
SHELL=/bin/csh
TERM=hp
export TERM
ret -c ret_alive_check1.cmd > /dev/null
Still will not work for me in crontab -- works fine at command line !!
Pulling my hair out at moment !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2001 08:08 AM
08-21-2001 08:08 AM
Re: running scripts in crontab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2001 08:23 AM
08-21-2001 08:23 AM
Re: running scripts in crontab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2001 08:34 AM
08-21-2001 08:34 AM
Re: running scripts in crontab
Is ret a gui program?
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2001 08:40 AM
08-21-2001 08:40 AM
Re: running scripts in crontab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2001 08:57 AM
08-21-2001 08:57 AM
Re: running scripts in crontab
From a root login capture your environment variables:
env > /tmp/root_env
From your crontab script, add a line like this:
env >/tmp/cron_env
Then do a "diff" and add any missing variables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2001 09:01 AM
08-21-2001 09:01 AM
Re: running scripts in crontab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2001 09:27 AM
08-21-2001 09:27 AM
Re: running scripts in crontab
use FQPN for your program rat. i.e if your executable rat is in /opt/rat/bin then in script use
/opt/rat/bin/rat -c ?????? > /dev/null
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2001 03:18 PM
08-21-2001 03:18 PM
Re: running scripts in crontab
if I read your script right, you are using the C-shell
from within it. Well, then it will perhaps try to be
"interactive" and that would need a "controlling
terminal" which will not be available if called from
"cron"... There is an option for the C-shell to NOT
start interactively, though, you might try that...
HTH,
Wodisch