After I connect to a target via one of the protocols and get the files,
Can I write a list of files transferred to a new file along with the total number of files transferred using GoAnyWhere director?
Eventually this file will act as a delivery report and will be sent back to the source via one of the transfer protocols.
Log of transferred files
Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
- Support_Rick Offline
- Support Specialist
- Posts: 590
- Joined: Tue Jul 17, 2012 2:12 pm
- Location: Phoenix, AZ
- Contact:
Re: Log of transferred files
Yes, this is possible.
This information is available to you in the form of a FILELIST variable. The Number of Files transferred also becomes available to you as well.
On the OUTPUT VARIABLES tab when doing a GET/PUT, there are 3 variables available to create. Source FileList, Destination FileList and Number of files transferred.
Once the files have been retrieved, you can do a FOREACH loop across the Destination FileList Variable created from the FTP|Get. This gives you access to all the file attributes (ie., Name, size, last modified date, extension, etc.) and write that to a CSV, flatfile or even a Database table.
Please review these Tips & Tricks articles from our Forum for further information:
Using FileList via SFTP
Taking Advantage of FileList Variables
HTH!
This information is available to you in the form of a FILELIST variable. The Number of Files transferred also becomes available to you as well.
On the OUTPUT VARIABLES tab when doing a GET/PUT, there are 3 variables available to create. Source FileList, Destination FileList and Number of files transferred.
Once the files have been retrieved, you can do a FOREACH loop across the Destination FileList Variable created from the FTP|Get. This gives you access to all the file attributes (ie., Name, size, last modified date, extension, etc.) and write that to a CSV, flatfile or even a Database table.
Please review these Tips & Tricks articles from our Forum for further information:
Using FileList via SFTP
Taking Advantage of FileList Variables
HTH!
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Re: Log of transferred files
Rick,
Thanks for the quick reply.
I understood the output variables part,
So far here's what I have.
How can use these variables to write out to a file? What task am I looking for after the above, is it the FileList task? how can use it so that I can create a file containing the information that I want...
Thanks for the quick reply.
I understood the output variables part,
So far here's what I have.
Code: Select all
copy label="Copy to NW folder" sourceFile="${thisFile:name}" destDir="destination/" whenFileExists="skip" numFilesCopiedVariable="copiedFiles" destinationFilesVariable="destFiles" version="1.0" logLevel="debug" executeOnlyIf="${ FileExists == False }" onError="setVariable:NwErr=1" />
<if label="Network Error?" condition="${ NwErr gt 0 }">
<setVariable label="Set: Email_Subject" name="Email_Subject" value="*ERROR* : ${system.project.name} -- FTP File Transfer Error on Destination" version="2.0" />
<setVariable label="Set: Email_Message" name="Email_Message" value="File Transfer error!${system.carriageReturn}File: ${ thisFile:name }${system.carriageReturn}Error:${system.carriageReturn}${ system.job.error }" version="2.0" />
<callModule label="(Module) Send Error Email" module="On Error" version="1.0" />
<iterateLoop />
</if>
- Support_Rick Offline
- Support Specialist
- Posts: 590
- Joined: Tue Jul 17, 2012 2:12 pm
- Location: Phoenix, AZ
- Contact:
Re: Log of transferred files
This is the info that I was referring to in the links ... try looking through this and see if you can use it to do what you need:
The idea here is to loop through the FileList and get to the File Information. In this example, I'm looping through the list of files that I pulled back from an SFTP|Get command where I created the ${locFiles} FileList variable.
As I loop through that list, I'm writing out a record to a physical file (MyFileList.csv) and appending the information to that file and creating the .CSV file on the fly.
It should be obvious that I can use the ${NoFiles} variable where ever to get that value.
Code: Select all
<module name="Main">
<createWorkspace version="1.0" />
<sftp label="Connect to Server" resourceId="sFTP ResourceID" version="1.0">
<get label="Get Files" destinationDir="${system.job.workspace}" destinationFilesVariable="locFiles" numFilesDownloadedVariable="NoFiles">
<fileset dir="/Demos/outbound">
<wildcardFilter>
<include pattern="*.csv" />
</wildcardFilter>
</fileset>
</get>
</sftp>
<forEachLoop label="Loop through locFiles" itemsVariable="${locFiles}" currentItemVariable="ThisFile">
<print label="Write File Info to CSV file" file="MyFileList.csv" append="true" version="1.0">
<![CDATA[${ThisFile:name},${ThisFile:size},${ThisFile:lastModifiedDate}${system.carriageReturn}]]>
</print>
</forEachLoop>
</module>
As I loop through that list, I'm writing out a record to a physical file (MyFileList.csv) and appending the information to that file and creating the .CSV file on the fly.
It should be obvious that I can use the ${NoFiles} variable where ever to get that value.
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Re: Log of transferred files
thanks a lot, that helped!