Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: SFTP File Size
Topic Summary: File size on an sftp
Created On: 03/13/2018 06:21 AM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by WilhelmEvans, on Tuesday, March 13, 2018 9:36 AM

Answer:
I figured it all out. added a second variable so one captures file name and second file size. added to the end of the email with the sftp file sizes at the top and I have what I need. Hope this helps others.
 03/13/2018 06:21 AM
User is offline View Users Profile Print this message

Author Icon
WilhelmEvans
Journeyman (50-99)

Posts: 85
Joined: 10/30/2014

I'm being asked to accomplish this, but I'm not sure it can be done. Is it possible for Automate 9 to look and provide the size of a file on an SFTP before it brings the file over? Perhaps place the file name and size in a variable then get the file name and size after the transfer and place in another variable for comparison.

 Category Survey
 03/13/2018 09:09 AM
User is offline View Users Profile Print this message

Author Icon
WilhelmEvans
Journeyman (50-99)

Posts: 85
Joined: 10/30/2014

I have found something that works, but just a bit off. I can get the ftp data I need, but I'm having issues getting the same data in our folders. here's the task I currently have set up. Am I missing something? From our folders I need to put in an email, the file name and file size.

<AMVARIABLE NAME="Cadence1"></AMVARIABLE>
<AMVARIABLE NAME="Cadence2"></AMVARIABLE>
<AMVARIABLE NAME="Cadence3"></AMVARIABLE>
<AMFTP ACTIVITY="logon" AM_ONERROR="CONTINUE" SERVER="****" USERNAME="******" PASSWORD="****" TYPE="sftp" PORT="****" SESSION="cadence" />
<AMFTP ACTIVITY="advanced" AM_ONERROR="GOTOSTEP" AM_GOTOSTEP="19" FTPCOMMAND="long_list" PARAMETER="/Inbox/*" FTPLONGLISTDATASET="FileList1" SESSION="cadence" />
<AMLOOP TYPE="DATASET" DATASET="FileList1">
<AMIF EXPRESSION="%DateDiff("d", DateValue(FileList1.FTPFileDate), Now())% < 1" AM_ONERROR="GOTOSTEP" AM_GOTOSTEP="19">
<AMFILESYSTEM ACTIVITY="write_file" AM_ONERROR="GOTOSTEP" AM_GOTOSTEP="19" FILE="C:\Artiva\done\test\NWMed.txt" RESULTVARIABLE="Cadence1">%FileList1.FTPFileName% %FileList1.FTPFileSize%</AMFILESYSTEM>
</AMIF>
</AMLOOP>
<AMFTP ACTIVITY="logoff" AM_ONERROR="CONTINUE" SESSION="cadence" />
<AMFILESYSTEM ACTIVITY="read_file" FILE="C:\Artiva\done\test\NWMed.txt" RESULTVARIABLE="Cadence3" />
<AMFILESYSTEM ACTIVITY="get" SOURCE="\\KDCFS01\Artiva\Cadence\Inbox\*" RESULTVARIABLE="Cadence2" FILEPROPERTY="size" ISNEWERTHAN="%DateAdd( "h", -24, CStr( Now() ))%" />
<AMPAUSE ACTION="waitfor" SCALAR="2" />
<AMSENDEMAIL FROM="*****" TO="********" SUBJECT="*****file sizes (Cadence)" ATTACH="C:\Artiva\done\test\NWMed.txt">File(s) sizes on SFTP
%Cadence3%

\\******\Artiva\Cadence\Inbox File(s) sizes:
%Cadence2%</AMSENDEMAIL>
<AMPAUSE ACTION="waitfor" SCALAR="2" />
<AMFILESYSTEM ACTIVITY="delete" SOURCE="C:\Artiva\done\test\NWMed.txt" />
<AMSTOPTASK STATUSTYPE="SUCCESS" />
<AMFTP ACTIVITY="logoff" AM_ONERROR="CONTINUE" SESSION="cadence" />

 Category Survey
 03/13/2018 09:36 AM
User is offline View Users Profile Print this message

Author Icon
WilhelmEvans
Journeyman (50-99)

Posts: 85
Joined: 10/30/2014

Answer Answer
I figured it all out. added a second variable so one captures file name and second file size. added to the end of the email with the sftp file sizes at the top and I have what I need. Hope this helps others.

 Category Survey
 03/13/2018 09:50 AM
User is offline View Users Profile Print this message

Author Icon
Ricardo Castaneda
HelpSystems

Posts: 3424
Joined: 01/11/2008

Hello,

I apologize for the delayed response and appreciate the update you have provided on this.

 Category Survey


-------------------------

Ricardo Castaneda | Principal Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700
Statistics
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 539 guests browsing this forum, which makes a total of 539 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2019 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog