#!/bin/bash #-----------------------------------------------------------------------# Script name:inf_impobj.sh# purpose:to batch export mappings or workflows to XML files # Created by:indifferent_to# date:2014-11-26 #------------- ---------------------------------------------------------function Usage {cat <<eouusage:inf_impobj.sh-l < List_file>-D <output_folder>-w/-m/-s/-t <user_name>eouexit 1}repository= "repository name" domain= " Repository domain "host=" Informatica Server host name "port=" Informatica Server port number "_user_name=_password=_obj_ type=mappinglist_file=output_folder=if [!-n "$"]; Thenusageelsewhile truedocase $ in-l) List_file=$2shift 2;; -d) output_folder=$2shift 2;; -W) _obj_type=workflow_user_name=$2break;; -s) _obj_type= "source" _user_name=$2break;; -T) _obj_type= "target" _user_name=$2break;; -m) _user_name=$2break;; *) if [!-n "$"]; Thenbreak; Usageelse echo "Invalid argument"; Break;usagefi;; EsacdonefipmrEP Connect-r $repository-H $host-O $port-n $_user_name-s $domainif [$-ne 0]; Thenecho "Can not connect to the Informatica repository!" Exit 1; Firow_count= ' cat $list _file|wc-l ' success=0fail=0for ((row=1;row<= $row _count;row++)) doobject_name= ' Sed-n ${row} ' P ' $list _file ' object_name= ' echo $object _name|sed ' s/\\r//g ' #pmrep objectexport-n $object _name-o $_obj_type-m-F Clie Nt_delpdw-s-b-r-U ${output_folder}/${object_name} ". xml" >>infa_expobj.logpmrep objectexport-n $object _name-o $_obj_type-m-F client_delpdw-b-U ${output_folder}/${object_name} ". xml" >>infa_expobj.logif [$?-eq 0]; Thenlet success= $success +1 echo "${object_name} export successfully!" Elselet fail= $fail +1echo "${object_name} fail to export." fi#if [_obj_type= "Sourcce"]; Then#new_object_name= ' echo $object _name|sed ' s/flatfile.//g ' #mv ${output_folder}/${object_name} '. xml ' ${output_ Folder}/${new_object_name} ". xml" #fidoneecho "$success success; $fail fail"
Bulk export of the shell script for Informatica Object