- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: script with symcli command not work in cron
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-30-2003 10:44 AM
11-30-2003 10:44 AM
script with symcli command not work in cron
I have a script with the following lines:
#!/usr/bin/ksh
SYMCLI_DB_FILE=/var/symapi/db/symapi_db.bin
/usr/symcli/bin/symmir -g bcv1 query > /tmp/bcv_list
The script works find if I submit in Unix promot, but it didn't work if I put the script in the cron. Any idea.
Thanks,
Simon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2003 10:48 AM
11-30-2003 10:48 AM
Re: script with symcli command not work in cron
What are the permissions/ownership on the script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2003 10:56 AM
11-30-2003 10:56 AM
Re: script with symcli command not work in cron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2003 11:02 AM
11-30-2003 11:02 AM
Re: script with symcli command not work in cron
Presumably you're running the script from root's cron?
Also check /var/adm/cron/log.
Is the cron job listed there? It should show a rc??
Cheers
Con
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2003 11:04 AM
11-30-2003 11:04 AM
Re: script with symcli command not work in cron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2003 11:09 AM
11-30-2003 11:09 AM
Re: script with symcli command not work in cron
(ie export SYMCLI_DB_FILE)
I've had problems with cron in the past when I didn't export the variable.
Cheers
Con
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2003 11:17 AM
11-30-2003 11:17 AM
Re: script with symcli command not work in cron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2003 06:15 PM
11-30-2003 06:15 PM
Re: script with symcli command not work in cron
To debug the script problem, I always append output from every step of the script to a full path logfile, which permission could be 777.
Good luck.
twang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2003 04:38 AM
12-02-2003 04:38 AM
Re: script with symcli command not work in cron
In addition to checking permissions, and exporting your variables, you should make sure that the script is running under root's crontab. Also, try sourcing the user's environmental files in the script. That would make your script look something like this:
#!/usr/bin/ksh
. /my/user's/home/directory/.profile
. /my/user's/home/directory/.kshrc
export SYMCLI_DB_FILE=/var/symapi/db/symapi_db.bin
/usr/symcli/bin/symmir -g bcv1 query > /tmp/bcv_list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2003 04:48 AM
12-02-2003 04:48 AM
Re: script with symcli command not work in cron
>>The script works find if I submit in Unix promot, but it didn't work if I put the script in the cron. Any idea.>>
When you login, your .profile is sourced which sets up your environment variables.
Cron runs in a pseudo environment. So any environment variables needed would have to be set in the script.
set -x will help you find what is not being set.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2003 05:14 AM
12-02-2003 05:14 AM
Re: script with symcli command not work in cron
since you do not redirect errors, you might find error ouput in mail.
If the command ran, it should have created /tmp/bcv_list no matter what other errors come from the programme.
Can you post the crontab entry?
use:
#!/usr/bin/ksh
export SYMCLI_DB_FILE=/var/symapi/db/symapi_db.bin
/usr/symcli/bin/symmir -g bcv1 query > /tmp/bcv_list 2>&1
greetings,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2003 05:29 AM
12-02-2003 05:29 AM
Re: script with symcli command not work in cron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2003 05:38 AM
12-02-2003 05:38 AM
Re: script with symcli command not work in cron
thanks for the points. Would you enlighten us as to the cause of the problem and the solution?
thanks,
Michael