echo|exp file=>(gzip|split -b 2047m - exp.dmp.) userid=system/passwd
full=y
It performs a full database export and compress the export file on the
fly. When the first compressed file is larger than 2G, it will create
a second compressed export file, and so on. So for the large database,
the export files look like:
exp.dmp.aa
exp.dmp.ab
exp....
It was so convenient to use. However, I could not seem to be able to
run it with KSH in AIX. In AIX, it doesn't recognize file=>
Has anyone come across the similar issue in AIX? What is the
workaround?
TIA
Limin.
I suspect the idiom => is misleading here; rather it seems to be part
of a process substitution >( ... ) Process substitution is available
not before ksh93, AFAIKT, but the ksh's on the AIX versions I used ten
years ago were all ksh'88.
Janis
process substitution is available in some ksh88 as well as long
as the system supports /dev/fd/<x>.
When the system doesn't have /dev/fd/<x>, you can use named
pipes instead.
mkfifo p
< p gzip | split -b 2047m - exp.dmp. &
echo | exp file=p user...
If the system has /dev/fd/<x> but ksh88 just happens to miss the
process substitution feature, then you can do:
{
echo | exp file=/dev/fd/3 useri... 3>&1 >&4 |
gzip | split -n 2047m - exp.dmp.
} 4>&1
Note that not all implementations of process substitution allow
it to be part of a word.
--
Stï¿œphane
Thanks a lot for the explanations. I don't see /dev/fd/<x> in my aix
box, so I tested Stéphane's first suggestion, it works perfectly.
Limin.
On Sep 9, 4:49 pm, Stephane CHAZELAS <stephane_chaze...@yahoo.fr>
wrote:
> Stéphane
Why needs '>&4' and '4>&1' here? What do they do?
> Note that not all implementations of process substitution allow
> it to be part of a word.
>
> --
> Stéphane
If you want to make things tidy, you could do:
{
echo 4>&- | exp file=/dev/fd/3 useri... 3>&1 >&4 4>&- |
gzip 4>&- | split -n 2047m - exp.dmp. 4>&-
} 4>&1
To close that fd 4 fall all the commands as none of them use it
(nor should they use it).
--
Stï¿œphane
Thanks very much :)