- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Script Execution Unable to Log When Executed V...
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
Discussions
Discussions
Forums
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
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
тАО01-12-2010 12:37 AM
тАО01-12-2010 12:37 AM
Did some minor troubleshooting:
1. Checked the user that executes the job if he is a member of the cron.allow file.
2. Checked Directory Permissions
3. Changed the default shell of the user from /usr/bin/sh to /sbin/sh
4. Placed an ampersand "&" at the end of the script in crontab (e.g.: * * * * * /dir/script.sh &)
But to no avail. What seems to be the problem with cron?
TIA
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-12-2010 12:57 AM
тАО01-12-2010 12:57 AM
Solutioncan you please sahre the O/ps of the job as run maunally as well as the error that you get while executing the job as with cron.
the cron logs you can find at /var/adm/cron/log file.
please share as well the O/p of the command
crontab -e as run as root
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-12-2010 01:08 AM
тАО01-12-2010 01:08 AM
Re: Script Execution Unable to Log When Executed Via Cron
I placed several lines inside my scripts to echo everything that it does to a file. There are actually two parts of the script logging. 1st part it logs the date, time of execution. 2nd part it logs several select commands to the DB.
The log looks like this when executed manually:
===> START Tue Jan 12 04:30:00 EAT 2010
Date From:
Date To:
Processing DM ACR
Interactive mode off.
(1 row affected)
Create table tempdb..XXX_ACR
(0 rows affected)
Extract ACR for Stream 0
(643 rows affected)
Consolidate data for Stream 0
===> END Tue Jan 12 15:09:52 EAT 2010
However when executed via cron, it only outputs:
===> START Tue Jan 12 15:14:00 EAT 2010
Date From:
Date To:
Processing DM ACR
Interactive mode off.
===> END Tue Jan 12 15:14:01 EAT 2010
I dont know why this is happening when the scripts is executed via cron.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-12-2010 01:16 AM
тАО01-12-2010 01:16 AM
Re: Script Execution Unable to Log When Executed Via Cron
what are your crontab entries for the same job , can you please tell.
try redirecting the O/P as well as errors to some file and check.
also you can check actual result that this should perform sa run as a cron job for the same.
regards
sujit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-12-2010 01:17 AM
тАО01-12-2010 01:17 AM
Re: Script Execution Unable to Log When Executed Via Cron
PATH=/usr/sbin:/usr/bin:/whatever....
(You can copy this variable from the one that your system is using - see profile for root)
Best regards,
Horia.
Horia.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-12-2010 01:24 AM
тАО01-12-2010 01:24 AM
Re: Script Execution Unable to Log When Executed Via Cron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-12-2010 01:41 AM
тАО01-12-2010 01:41 AM
Re: Script Execution Unable to Log When Executed Via Cron
>>PATH is already defined in the user's .profile ..<<
Please notice that no login is performed when a cron job is executed, hence the user's .profile is not read.
You should define your variables or the full command paths in your script.
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-12-2010 01:45 AM
тАО01-12-2010 01:45 AM
Re: Script Execution Unable to Log When Executed Via Cron
Horia.
Horia.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-12-2010 03:05 AM
тАО01-12-2010 03:05 AM
Re: Script Execution Unable to Log When Executed Via Cron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-12-2010 03:06 AM
тАО01-12-2010 03:06 AM
Re: Script Execution Unable to Log When Executed Via Cron
Horia.
Horia.