Re: Using onunload command in shell script
Posted in 2001
Topics: Server Administration, Migration, Import/Export & Data Conversion
Its the << redirect.
brett
Muhammad Usman wrote:
>
> Hi!
>
> My shell script contains:
>
> #!/bin/sh
> #
> mt -f /dev/rmt/1 rewind
> #
> # Stores7 Database Tables.
> onunload -t /dev/rmt/1n -b 1024 -s 68157440 stores7:call_type << @ 2>&1
> echo '\\n'
> onunload -t /dev/rmt/1n -b 1024 -s 68157440 stores7:catalog << @ 2>&1
> echo '\\n'
> onunload -t /dev/rmt/1n -b 1024 -s 68157440 stores7:cust_calls << @ 2>&1
> echo '\\n'
> onunload -t /dev/rmt/1n -b 1024 -s 68157440 stores7:customer << @ 2>&1
> echo '\\n'
> onunload -t /dev/rmt/1n -b 1024 -s 68157440 stores7:items << @ 2>&1
> echo '\\n'
> onunload -t /dev/rmt/1n -b 1024 -s 68157440 stores7:log_record << @ 2>&1
> echo '\\n'
> onunload -t /dev/rmt/1n -b 1024 -s 68157440 stores7:manufact << @ 2>&1
> echo '\\n'
> onunload -t /dev/rmt/1n -b 1024 -s 68157440 stores7:orders << @ 2>&1>
> The above script only executes the first onunload command and come out from
> the script.
>
> Can anyone help me on this.
>
> regards
>
> Muhammad Usman
> musman@iffco.com
>
> ------------------------------------------------------------
> Get your FREE web-based e-mail and newsgroup access at:
> http://MailAndNews.com
>
> Create a new mailbox, or access your existing IMAP4 or
> POP3 mailbox from anywhere with just a web browser.
> ------------------------------------------------------------
--
-----------------------------------------------------------------
Brett's 13th law of UNIX administration...
The 13th sucks, we'll skip this one
-----------------------------------------------------------------
Brett Geer - UNIX Admin/Analyst/Programmer - Intratex Holdings.
Tel. +27 31 717 4000 Direct. +27 31 717 4146
Fax. +27 31 717 4001
-----------------------------------------------------------------
The little voices are talking to me again, telling me of a long
forgotten rhyme... the Rhyme of the Ancient Sysadmin
# ps -ef | kill -9 `awk '/albatross/{print $2}'`
-----------------------------------------------------------------
Also,
from what I see everytime you issue the onunload command, it's going to rewrite
over the previous onunload, unless you have a no rewind device as a tape drive.
Brett Geer wrote:
> Its the << redirect.
>
> brett
>
> Muhammad Usman wrote:
> >
> > Hi!
> >
> > My shell script contains:
> >
> > #!/bin/sh
> > #
> > mt -f /dev/rmt/1 rewind
> > #
> > # Stores7 Database Tables.
> > onunload -t /dev/rmt/1n -b 1024 -s 68157440 stores7:call_type << @ 2>&1
> > echo '\\n'
> > onunload -t /dev/rmt/1n -b 1024 -s 68157440 stores7:catalog << @ 2>&1
> > echo '\\n'
> > onunload -t /dev/rmt/1n -b 1024 -s 68157440 stores7:cust_calls << @ 2>&1
> > echo '\\n'
> > onunload -t /dev/rmt/1n -b 1024 -s 68157440 stores7:customer << @ 2>&1
> > echo '\\n'
> > onunload -t /dev/rmt/1n -b 1024 -s 68157440 stores7:items << @ 2>&1
> > echo '\\n'
> > onunload -t /dev/rmt/1n -b 1024 -s 68157440 stores7:log_record << @ 2>&1
> > echo '\\n'
> > onunload -t /dev/rmt/1n -b 1024 -s 68157440 stores7:manufact << @ 2>&1
> > echo '\\n'
> > onunload -t /dev/rmt/1n -b 1024 -s 68157440 stores7:orders << @ 2>&1> >
> > The above script only executes the first onunload command and come out from
> > the script.
> >
> > Can anyone help me on this.
> >
> > regards
> >
> > Muhammad Usman
> > musman@iffco.com
> >
> > ------------------------------------------------------------
> > Get your FREE web-based e-mail and newsgroup access at:
> > http://MailAndNews.com
> >
> > Create a new mailbox, or access your existing IMAP4 or
> > POP3 mailbox from anywhere with just a web browser.
> > ------------------------------------------------------------
>
> --
>
> -----------------------------------------------------------------
> Brett's 13th law of UNIX administration...
> The 13th sucks, we'll skip this one
> -----------------------------------------------------------------
> Brett Geer - UNIX Admin/Analyst/Programmer - Intratex Holdings.
> Tel. +27 31 717 4000 Direct. +27 31 717 4146
> Fax. +27 31 717 4001
> -----------------------------------------------------------------
> The little voices are talking to me again, telling me of a long
> forgotten rhyme... the Rhyme of the Ancient Sysadmin
> # ps -ef | kill -9 `awk '/albatross/{print $2}'`
> -----------------------------------------------------------------
--
Phillip Tien
Database Administrator
Whole Foods Market, Inc.
Doctors say he has a 10% chance of living, though there's only a 50% chance of
that.