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: First Loop Attempt
Topic Summary: keeping you busy
Created On: 05/18/2015 12:07 PM
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:30 AM

Answer:
I got it all figured out.
 05/18/2015 12:07 PM
User is offline View Users Profile Print this message

Author Icon
WilhelmEvans
Journeyman (50-99)

Posts: 85
Joined: 10/30/2014

Below is my first attempt at looping through 19 files in a folder, and if true, archive them. Problem I'm having is actually 2 fold.  I intend on building on this for many different tasks.  1's problem is that after the files are archived, the loop continues looping.  I fear if I use this on an SFTP the 19 files would be sent up to 20 times to the client.  Any suggestions for both?  I just want the loop to stop once the 19 files are processed, either archiving or SFTP out.     <AMLOOP TOTALLOOPS="20"><AMIF EXPRESSION="%FileCount("\\2kknt4\unix\client\auto"% = 19">     <AMFILESYSTEM ACTIVITY="move" SOURCE="\\2kknt4\unix\client\auto\*.*" DEST="\\2kknt4\unix\client\auto\Archive\*.*" />     </AMIF>          <AMPAUSE ACTION="waitfor" SCALAR="30" />     </AMLOOP>

 Category Survey
 05/18/2015 12:45 PM
User is offline View Users Profile Print this message

Author Icon
Gijsberth de Ruiter
Artisan (200-499)

Posts: 455
Joined: 03/30/2005

Can you describe what you want to automate? I do not think the loop is teh best solution, but I need understanding your issue better.

 Category Survey


-------------------------
I am an A-Team Member
 05/18/2015 01:13 PM
User is offline View Users Profile Print this message

Author Icon
WilhelmEvans
Journeyman (50-99)

Posts: 85
Joined: 10/30/2014

I want to start using the loop function in certain folders to ensure there are the correct amount of files in there before my tasks begin processing, this will also include other folders that I need to verify the correct amount of files are there before I SFTP them back to our clients. 

 Category Survey
 05/19/2015 05:19 AM
User is offline View Users Profile Print this message

Author Icon
Gijsberth de Ruiter
Artisan (200-499)

Posts: 455
Joined: 03/30/2005

If you just want to test if a folder has enough files, you better use an if action. Which decides whetyher the tasks continues or is rescheduled. A loop does not seem to give the right results in my view, but only based on teh limited info you supplied.

 Category Survey


-------------------------
I am an A-Team Member
 05/19/2015 06:38 AM
User is offline View Users Profile Print this message

Author Icon
WilhelmEvans
Journeyman (50-99)

Posts: 85
Joined: 10/30/2014

If it's not too much trouble, can you give me simple generic if statement that looks in a folder to see if there are 3 files.  Here are my steps:1. dowload (3) files2. if there are 3 files move to next step, if not, attempt download again.  after 3 attempts send email notification.  3. process files4. archive files

 Category Survey
 05/19/2015 06:57 AM
User is offline View Users Profile Print this message

Author Icon
FredShindle
Apprentice (20-49)

Posts: 33
Joined: 12/31/2009

I had a similar issue and posted on 04/13 questions.
Long story short what I was told by support was there is a bug with 'loop/if' logic if you are setting criteria like 'older than x days', the logic does not work.
In my case the logic would work in reverse, files older than were kept and all others (the ones you wanted to keep) were deleted...yeah caused some problems.

I was told to upgrade to 10.1.
Not and easy feat to fix a commonly used logic.

 Category Survey
 01/11/2018 11:29 AM
User is offline View Users Profile Print this message

Author Icon
MarshallShelley
n00b (>6 posts)

Posts: 2
Joined: 01/11/2018

I have a similar issue. I am currently on 10.7 I am trying setup a stop all for all my folders and tasks for emergency purposes. This is what I have so far:

<AMLOOP ACTIVITY="processes" RESULTVARIABLE="n" RESULTDATASET="AllTask" INCLUDE="C:\ProgramData\AutoMate\AutoMate 10\Tasks" EXCLUDE="C:\ProgramData\AutoMate\AutoMate 10\*move*" SORT="descending">

 Category Survey
 01/12/2018 03:02 PM
User is offline View Users Profile Print this message

Author Icon
Alex Escalante
HelpSystems

Posts: 871
Joined: 02/26/2014

Hello Marshall,

Can you please elaborate on what criteria would need to be met in order to stop? Are you trying to stop all running tasks? or stop the current loop?

 Category Survey


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

Alex Escalante | Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700 | F: +1.213.738.7665
 03/13/2018 09:30 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 got it all figured out.

 Category Survey
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 194 guests browsing this forum, which makes a total of 194 users using this forum.

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

Sitemap Network Automation Software Blog