- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- cronjob not working by oracle user
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-04-2008 09:49 PM
08-04-2008 09:49 PM
My customer is having HP-ux 11.31 with oracle installed & user is xoracle.
my crontab entry for xoracle user is
$ crontab -l
0,10,20,30,40,50 * * * * sh /XOSoracle/XOSUPLOADBATCH/XOSUPLOADBATCH
0,10,20,30,40,50 * * * * date>/tmp/vjta1.txt
but its not working i have tried with su -xoracle -c <script> with root user crontab still its not working.
Pls help
Thanks
vjta
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2008 09:58 PM
08-04-2008 09:58 PM
Re: cronjob not working by oracle user
Check your /usr/lib/cron/cron.allow (linked to /var/adm/cron/cron.allow) file. You can execute crontab only if your name appears in that file. Also look in /var/adm/cron/log file for errors.
If there are no entried in the above file, add the user names you want the cron to execute one by one as below:
root
oracle
Regards,
Rasheed Tamton.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2008 10:05 PM
08-04-2008 10:05 PM
Re: cronjob not working by oracle user
Thanks for ur Reply I already added user entry in cron.allow * in logs its not showing anything.
Pls see:
# pwd
/var/adm/cron
# cat cron.allow
root
adm
uucp
xoracle
Thanks
vjta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2008 10:12 PM
08-04-2008 10:12 PM
Re: cronjob not working by oracle user
0,10,20,30,40,50 * * * * date>/tmp/vjta1.txt
In that case, just give the full path for the commands you use in the cron, i.e., instead of sh give the full path of sh (/usr/bin/sh) and do it for the date also. You have to always give the full path of the commands when you use it in the cron.
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2008 10:16 PM
08-04-2008 10:16 PM
Re: cronjob not working by oracle user
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2008 10:25 PM
08-04-2008 10:25 PM
Re: cronjob not working by oracle user
I assume the missing space between the "-" and xoracle is just a typo?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2008 12:50 AM
08-05-2008 12:50 AM
Re: cronjob not working by oracle user
Pls seee my crontab entry:
# crontab -l
0,10,20,30,40,50 * * * * su -xoracle -c date>/tmp/vjta1.txt
0,10,20,30,40,50 * * * * su - xoracle -c usr/bin/sh /XOSoracle/XOSUPLOADBATCH/XOSUPLOADBATCH
can u pls tell me how to deal with executable script in crontab
regards
Vjta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2008 12:52 AM
08-05-2008 12:52 AM
Re: cronjob not working by oracle user
Pls seee my crontab entry:
# crontab -l
0,10,20,30,40,50 * * * * su - xoracle -c date>/tmp/vjta1.txt
0,10,20,30,40,50 * * * * su - xoracle -c usr/bin/sh /XOSoracle/XOSUPLOADBATCH/XOSUPLOADBATCH
can u pls tell me how to deal with executable script in crontab
regards
Vjta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2008 01:01 AM
08-05-2008 01:01 AM
Re: cronjob not working by oracle user
replace date with the full path /usr/bin/date
which date
/usr/bin/date
>usr/bin/sh /XOSoracle/XOSUPLOADBATCH/XOSUPLOADBATCH
(a slash is missing)
/usr/bin/sh
making executable:
ll /XOSoracle/XOSUPLOADBATCH/XOSUPLOADBATCH
check the permission of the file
chmod +x /XOSoracle/XOSUPLOADBATCH/XOSUPLOADBATCH
rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2008 01:03 AM
08-05-2008 01:03 AM
Re: cronjob not working by oracle user
for 1st entry i.e.
0,10,20,30,40,50 * * * * date>/tmp/vjta1.txt
its working & see the o/p of txt file
# cat /tmp/vjta1.txt
(c)Copyright 1983-2006 Hewlett-Packard Development Company, L.P.
(c)Copyright 1979, 1980, 1983, 1985-1993 The Regents of the Univ. of California
(c)Copyright 1980, 1984, 1986 Novell, Inc.
(c)Copyright 1986-2000 Sun Microsystems, Inc.
(c)Copyright 1985, 1986, 1988 Massachusetts Institute of Technology
(c)Copyright 1989-1993 The Open Software Foundation, Inc.
(c)Copyright 1990 Motorola, Inc.
(c)Copyright 1990, 1991, 1992 Cornell University
(c)Copyright 1989-1991 The University of Maryland
(c)Copyright 1988 Carnegie Mellon University
(c)Copyright 1991-2006 Mentat Inc.
(c)Copyright 1996 Morning Star Technologies, Inc.
(c)Copyright 1996 Progressive Systems, Inc.
Confidential computer software. Valid license from HP required for
possession, use or copying. Consistent with FAR 12.211 and 12.212,
Commercial Computer Software, Computer Software Documentation, and
Technical Data for Commercial Items are licensed to the U.S. Government
under vendor's standard commercial license.
Tue Aug 5 14:20:00 IST 2008
logout
here date is showing in 2ndlast line
whereas in log its shwing:
root 12814 c Tue Aug 5 14:20:00 IST 2008
< root 12812 c Tue Aug 5 14:20:00 IST 2008
< root 12814 c Tue Aug 5 14:20:00 IST 2008 rc=127
< root 12813 c Tue Aug 5 14:20:00 IST 2008 rc=127
ended with rc=127
regards
Vjta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2008 01:16 AM
08-05-2008 01:16 AM
Solutionrc=127 means that you are using the non-shell commands. Either the path for the commands are missing in the script. Check whether you have put the full path for the commands in the script.
Use -x in the shell (sh -x) or set -x to get the verbose output of the commands and redirect the output to a file as you did with the date command.
/usr/bin/sh -x scriptname
rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2008 05:28 AM
08-05-2008 05:28 AM
Re: cronjob not working by oracle user
#!/bin/ksh
(or a other shell)
that normaly will fix the error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2008 06:13 AM
08-05-2008 06:13 AM
Re: cronjob not working by oracle user
As mentioned by Rasheed, why use sh to execute your scripts?
The -c option needs to have its whole command quoted:
"/usr/bin/sh /XOSoracle/XOSUPLOADBATCH/XOSUPLOADBATCH"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2008 01:33 AM
08-13-2008 01:33 AM
Re: cronjob not working by oracle user
Can u please share d script with us...
i mean cat /usr/bin/sh /XOSoracle/XOSUPLOADBATCH/XOSUPLOADBATCH..
i suspect the ORACLE_HOME,ORACLE_SID not set in ur script...
please try it....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2008 03:32 AM
09-04-2008 03:32 AM
Re: cronjob not working by oracle user
sorry for the delay.
this script is running manually only problem thru cron.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2008 05:52 AM
09-04-2008 05:52 AM
Re: cronjob not working by oracle user
either:
0,10,20,30,40,50 * * * * su - xoracle -c /usr/bin/sh /XOSoracle/XOSUPLOADBATCH/XOSUPLOADBATCH
or in the script XOSUPLOADBATCH, make sure the first line is
#!/usr/bin/sh
then make the crontab entry:
0,10,20,30,40,50 * * * * su - xoracle -c /XOSoracle/XOSUPLOADBATCH/XOSUPLOADBATCH
If you still have issues, bear in mind cron supplies a very limited environment. You will probably need to fix the PATH or add full pathes to all commands for instance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2008 02:28 AM
11-27-2008 02:28 AM