- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Shell script problem
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-28-2003 12:38 PM
08-28-2003 12:38 PM
#!/bin/ksh
. /u01/app/oracle/.profile
TODAY=`date +'D%y%m%d.T%H%M%S'`
ORACLE_HOME=/u01/app/oracle/product/9.2.0
PATH=$ORACLE_HOME/bin
ORACLE_SID=TTWB
/bin/mkdir /u29/backup/ARC"$TODAY"
/bin/chmod 755 /u29/backup/ARC$TODAY
ARC_FILE=/tmp/archive.$TODAY.lst
/usr/bin/compress /u25/arch/*
$PATH/sqlplus /nolog <
archive log stop;
!/bin/cp -R `/bin/cat $ARC_FILE` /u29/backup/ARC$TODAY
It gave the following error:
SQL*Plus: Release 9.2.0.1.0 - Production on Thu Aug 28 16:33:43 2003
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> Connected.
SQL> ORA-00250: archiver not started
SQL> then: then/endif not found.
Usage: cp [-f|-i] [-p] [-S] [-e warn|force|ignore] source_file target_file
cp [-f|-i] [-p] [-S] [-e warn|force|ignore] source_file ... target_directory
cp [-f|-i] [-p] [-S] -R|-r [-e warn|force|ignore] source_directory ... target_directory
SQL> Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit Production
With the Partitioning option
JServer Release 9.2.0.1.0 - Production
If I rewrite the script as follow:
#!/bin/ksh
. /u01/app/oracle/.profile
TODAY=`date +'D%y%m%d.T%H%M%S'`
ORACLE_HOME=/u01/app/oracle/product/9.2.0
PATH=$ORACLE_HOME/bin
ORACLE_SID=TTWB
/bin/mkdir /u29/backup/ARC"$TODAY"
/bin/chmod 755 /u29/backup/ARC$TODAY
ARC_FILE=/tmp/archive.$TODAY.lst
/usr/bin/compress /u25/arch/*
$PATH/sqlplus /nolog <
archive log stop;
exit
/bin/cp -R `/bin/cat $ARC_FILE` /u29/backup/ARC$TODAY
It does not do the last line at all. Help please.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2003 12:44 PM
08-28-2003 12:44 PM
Re: Shell script problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2003 12:46 PM
08-28-2003 12:46 PM
Re: Shell script problem
Replace the exit with this
EOF
Then it will work.
#!/bin/ksh
. /u01/app/oracle/.profile
TODAY=`date +'D%y%m%d.T%H%M%S'`
ORACLE_HOME=/u01/app/oracle/product/9.2.0
PATH=$ORACLE_HOME/bin
ORACLE_SID=TTWB
/bin/mkdir /u29/backup/ARC"$TODAY"
/bin/chmod 755 /u29/backup/ARC$TODAY
ARC_FILE=/tmp/archive.$TODAY.lst
/usr/bin/compress /u25/arch/*
$PATH/sqlplus /nolog <
archive log stop;
EOF
/bin/cp -R `/bin/cat $ARC_FILE` /u29/backup/ARC$TODAY
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2003 01:06 PM
08-28-2003 01:06 PM
SolutionThe last line in the second script does not execute because of the exit right above it.
Then it will work.
#!/bin/ksh
. /u01/app/oracle/.profile
TODAY=`date +'D%y%m%d.T%H%M%S'`
ORACLE_HOME=/u01/app/oracle/product/9.2.0
PATH=$ORACLE_HOME/bin
ORACLE_SID=TTWB
/bin/mkdir /u29/backup/ARC"$TODAY"
/bin/chmod 755 /u29/backup/ARC$TODAY
ARC_FILE=/tmp/archive.$TODAY.lst
/usr/bin/compress /u25/arch/*
$PATH/sqlplus /nolog <
archive log stop;
exit;
EOF
/bin/cp -R `/bin/cat $ARC_FILE` /u29/backup/ARC$TODAY
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2003 05:24 AM
08-29-2003 05:24 AM