- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: cron causes script to fail
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-05-2005 06:15 AM
08-05-2005 06:15 AM
cron causes script to fail
Here is the script:
oracle@luna:default:o cat exp.ksh
#!/usr/bin/ksh
export ORACLE_SID=EBPROD
cd /ora_backup
rm exp_EBPROD.dmp.gz
mknod node1 p
gzip < node1 > exp_EBPROD.dmp.gz &
exp / file=node1 buffer=50000000 log=/ora_backup/exp_EBPROD.log statistics=none full=y grants=none indexes=y compress=none constraints=y direct=y
rm -f pipe.file
Basically, it sets up a pipe, dumps the export to the pipe, where it is picked up by gzip and output to a file
here is the crontab entry
59 10 * * * /bin/ksh -c '. $HOME/.profile; cd /ora_backup; /ora_backup/exp.ksh;'
here is the pertinent error from Oracle:
EXP-00002: error in writing to export fileerror closing export file node1
EXP-00000: Export terminated unsuccessfully
It lloks to me like oracle is unable to write to the pipe. And yet, it is able to do so when the script is run from the command line.
Any suggestions?
Dan Baker
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2005 06:21 AM
08-05-2005 06:21 AM
Re: cron causes script to fail
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2005 06:23 AM
08-05-2005 06:23 AM
Re: cron causes script to fail
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2005 06:24 AM
08-05-2005 06:24 AM
Re: cron causes script to fail
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2005 06:25 AM
08-05-2005 06:25 AM
Re: cron causes script to fail
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2005 06:29 AM
08-05-2005 06:29 AM
Re: cron causes script to fail
. /home/oracle/.profile
at the beginning of the job to include the oracle environment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2005 06:30 AM
08-05-2005 06:30 AM
Re: cron causes script to fail
I suspect that Pete is right in that the only changes from cron to command line tend to be the environment variables.
If you have not set all the same environment variables to run or the full path names are not used, its quite possible that certain files arent being found.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2005 06:46 AM
08-05-2005 06:46 AM
Re: cron causes script to fail
. /oravl01/oracle/.profile
Still no dice. Anyting else?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2005 06:49 AM
08-05-2005 06:49 AM
Re: cron causes script to fail
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2005 06:54 AM
08-05-2005 06:54 AM
Re: cron causes script to fail
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2005 06:57 AM
08-05-2005 06:57 AM
Re: cron causes script to fail
Sourcing oracles .profile is also problematic because it probably has commands like tset, stty, tabs ... which expect stdin to be a tty device. Surround all of those in .profile with
if [[ -t 0 ]]
then
tput ..
stty ..
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2005 07:10 AM
08-05-2005 07:10 AM
Re: cron causes script to fail
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2005 07:12 AM
08-05-2005 07:12 AM