Posted Thu, 26 Nov 2020 06:57:40 GMT by

I have a working loop through dataset that works on any of my network locations.

 

I'm trying to set this same process up to work AFTER I access an FTP site.  After I logon to the site, the "Get" step fails because it thinks the path does not exist. (it does)  I'm looping through a folder to move/delete files that are older than a certain amount of days.

 

I'm wondering if this is due to the FTP process and I need more steps added to get to the folder at the end of the path, or, if this is something that isn't possible.

 

I'm using 9.0.3.4

 

Thanks for any advice you can give!

Posted Fri, 04 Dec 2020 11:03:53 GMT by

Hi Ashely,

Sorry I don't understand.  What is the loop dataset used for?

Is the "Get" step the "FTP: Download" action?

The folder you're looping is a FTP folder or a local/network folder?

Sorry I'm not clear on the process. Is it possible to share your tasks/steps as well?

Posted Fri, 04 Dec 2020 23:05:16 GMT by

Here is the code that works if you are doing a "loop through" on the network.

 

<!--<AMFILESYSTEM ACTIVITY="get" SOURCE="Z:\PRIVATE\Ashley\APA\Processd" RESULTDATASET="netauto" FILEPROPERTY="creationtime" />-->
<!--<AMSET VARIABLENAME="var_counter">1</AMSET>-->
<!--<AMLOOP TYPE="DATASET" DATASET="netauto">-->
<!--     <AMLOOP TYPE="FOLDER" FOLDER="Y:\FrmClrHs\RemProc\ChrisTest" RESULTVARIABLE="var_filename">-->
<!--<AMFILESYSTEM ACTIVITY="read_file" FILE="%netauto.Fullname%" RESULTVARIABLE="var_index1" />-->
<!--          <AMSET VARIABLENAME="var_datedifference">%DateDiff(&quot;d&quot;, netauto.CreationTime, var_fileoutputdate)%</AMSET>-->
<!--          <AMIF EXPRESSION="%var_datedifference% &gt; 30">-->
<!--               <AMFILESYSTEM ACTIVITY="delete" SOURCE="%netauto.Fullname%" />-->
<!--          </AMIF>-->
<!--</AMLOOP>-->

 

What I'm trying to do is this same process, only, AFTER, I connect to an FTP/SFTP site.

 

Logically, once connected, the path in the "source" command, should put me in the correct location.  However, it doesn't seem to be working.

 

The ultimate goal is to have the script logon to the FTP/SFTP  site, access a specific folder, determine which files in that folder are over X amount of days old, and then, move or delete them.

 

Thanks for your time!

 

Ashley

Posted Sat, 05 Dec 2020 10:41:34 GMT by

Hi Ashley,

Only the FTP action can access FTP files/folders.  So the "Loop files" action would not be able to access an FTP directory.

If you want to loop through files on an FTP site, you'd need to use the FTP action to get a list of files, and then loop the list.

You must be signed in to post in this forum.