gunzip and ftp using a script @ a time
Friends ,
Using the following script I can FTP a file from a remote machine but I cannot gunzip that file at a time .The script is : ----------------------------------- x=scott.dmp.gz ftp -i -v -n 192.168.1.1 <<END_FTP user oracle Oracle binary cd /dump get $x bye gunzip $x ------------------------------------- Would anybody plz tell me , how can I gunzip that file using a one script . Waiting for reply ... ... |
x=scott.dmp.gz
ftp -i -v -n 192.168.1.1 <<END_FTP user oracle Oracle binary cd /dump get $x bye END_FTP gunzip $x The ftp cmd continues until it see the end marker |
Looks to me like you're missing the matching "END_FTP" tag so the gunzip $x is getting sent to the FTP server (yes, even though you've sent "bye" before that).
|
may i suggest scp since that wasdesigned for automating tasks unlike ftp which is designed to prompt the user for info...
|
Thx for your kind help ... ...
|
Friends ,
would you plz help me again . ftp -i -v -n 192.168.1.1 <<END_FTP user oracle Oracleconsole binary cd /dmfs/ababil_dump get $x END_FTP export ORACLE_SID=$z sqlplus "/ as sysdba" << ! alter user system identified by sys123; create or replace directory test_dir as '/rptdata/test_dir'; exit; cd /rptdata/test_dir /usr/bin/gunzip scott.dump.gz impdp system/sys123@$z directory=test_dir dumpfile=scott.dump content=all remap_schema=ababil:user1 In the above script, when I make exit from the oracle then I want to run the last 3 lines . But last 3 lines are not executed. Can you plz help me .. how can I execute the last 3 lines . |
Code:
ssh oracle@192.168.1.1 /usr/bin/gunzip /rptdata/test_dir/scott.dump.gz special characters mite need to be escaped somehow. |
All times are GMT -5. The time now is 07:13 AM. |