informatica读取FTP文件

以下为一个完整的informatica读取ftp文件,并导入到系统中。

第一步: 通过shell脚本下载压缩包文件

sh /home/infa/Informatica/9.5.1/server/infa_shared/crm_prod/shell/ftpFromLive.sh $$ZIP_FILE_NAME

shell脚本内容如下:

#!/bin/bash
filename=$1
ftp -niv xxx.xxx.xxx.xxx <<-EOF
user username password
binary
#服务器增加防火墙后,ftp请求已经修改为主动模式
passive
lcd /home/infa/
prompt
get $filename
close
bye
EOF

第二步: 使用shell脚本解压缩文件

sh /home/infa/Informatica/9.5.1/server/infa_shared/crm_prod/shell/zipfileLive.sh $$ZIP_FILE_NAME

 shell脚本如下:

#!/bin/bash 
filename=$1
cd /home/infa/
unzip -o $filename
rm $filename
exit 0

第三步:使用infor导入文件。

第四步: 删除文件

sh /home/infa/Informatica/9.5.1/server/infa_shared/crm_prod/shell/rmfileHive.sh $$FILE_NAME
#!/bin/bash
filename=$1
cd /home/infa/
rm $filename
exit 0
原文地址:https://www.cnblogs.com/30go/p/6134095.html