在数据传输过程中经常需要使用 FTP 传输文件,其基础操作是类似的,不同的部分可以使用配置文件。如下是关于 FTP 推送文件的基础配置。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| <Config> <Targets> <Target ID="CustomerCode" Description=""> <FTP Site="" UserName="" Password=""> <File Type="ASN" Template="FR*.xml.gpg" SourceFolder="D:\HUB_EDI\Test\FilePool\CustomerCode\ASN" UploadFolder="/ASN" BackupFolder="D:\HUB_EDI\Test\FilePool\CustomerCode\ASN\bak\" MailAppender="MailBusiness" /> <File Type="ASN_DIRECT" Template="FR*.xml.gpg" SourceFolder="D:\HUB_EDI\Test\FilePool\CustomerCode\ASN_DIRECT" UploadFolder="/ASN" BackupFolder="D:\HUB_EDI\Test\FilePool\CustomerCode\ASN_DIRECT\bak\" MailAppender="MailBusiness" /> </FTP> </Target> <Target ID="CustomerCode2" Description=""> <FTP Site="" UserName="" Password=""> <File Type="DN" Template="DN*.csv" SourceFolder="D:\HUB_EDI\Test\FilePool\CustomerCode2\OUT\" UploadFolder="/In" BackupFolder="D:\HUB_EDI\Test\FilePool\CustomerCode2\OUT\bak\" MailAppender="MailBusiness" /> <File Type="ASN" Template="ASN*.xls" SourceFolder="D:\HUB_EDI\Test\FilePool\CustomerCode2\OUT\" UploadFolder="/In" BackupFolder="D:\HUB_EDI\Test\FilePool\CustomerCode2\OUT\bak\" MailAppender="MailBusiness" /> </FTP> </Target> </Targets> <Log FileName="D:\HUB_EDI\Test\LogFiles\FtpFilePusher_%s.log" /> <Notification> <SMTP Server="172.31.7.240" UserName="" Password="" /> <Sender Value="edi_it@team.com" />
<Appender Name="MailBusiness"> <Level Value="success" /> <Receiver Value="busines@team.com" /> </Appender> <MailSpec> <Alarm Type="EXCEPTION" Subject="[FTP File Pusher][%s][EXCEPTION] Exception of Upload File" Receiver="edi_it@team.com" /> <Alarm Type="ERROR" Subject="[FTP File Pusher][%s][%s][ERROR] Upload File Failed:%s" Receiver="edi_it@sercomm.com" /> <Alarm Type="SUCCESS" Subject="[FTP File Pusher][%s][%s][SUCCESS] Upload File:%s Successfully" Receiver="edi_it@sercomm.com" /> </MailSpec> </Notification> </Config>
|
Notification
配置邮件发送的相关讯息。