Automic Workload Automation

 View Only
  • 1.  FTP directory testing

    Posted Feb 12, 2020 08:20 AM

    Hi All,

    I need some help!

    I have to make a job that testing directory existing on FTP server  than download all files if the condition is yes.

    How can I test it with FTP commands?

    Thank your help in advance!

    Bálint



  • 2.  RE: FTP directory testing

    Posted Feb 12, 2020 08:28 AM

    Hello.

    What's your FTP client? RA agent or something else? Or is that as of yet undecided? In the later case: what's your target platform?

    You'll find a majority of people are in a much better position to provide you with faster quality answers if provided with the essential information ahead of time.

    Thanks!




  • 3.  RE: FTP directory testing

    Posted Feb 12, 2020 08:37 AM
    Edited by Balint Horvath Feb 12, 2020 08:38 AM

    Hi Carsten,

    Thank your fast react. Sorry I had not writen details.

    I use WA Agent to call and enter FTP. The host is Linux.

    Thank you! :)




  • 4.  RE: FTP directory testing

    Posted Feb 12, 2020 09:53 AM
    ​Hi Balint,

    Unfortunately I don't know of any WA agent. In case you meant the RA agent, and I hope I understand your request correctly:

    Any attempt to either list a directory that doesn't exist, or cd into it will result in a failure. That failure will result in an ENDED_NOT_OK.

    You can either do it like shown below in one job, and have the "Abort the job on command failure" box checked. Or you split it into two FTP jobs, put them in a job plan. The first does an "ls" or "dir" as shown below, and the second fetches all files only on the condition that the first one was ENDED_OK.


    Hth,


  • 5.  RE: FTP directory testing

    Posted Feb 12, 2020 09:59 AM

    Yes I thought about this idea but it makes more ENDED_NOT_OK report in the process monitoring :)




  • 6.  RE: FTP directory testing

    Posted Feb 12, 2020 10:55 AM
    Well ... now that's a requirement I can not ​offer any immediate assistance with :)



  • 7.  RE: FTP directory testing
    Best Answer

    Posted Feb 12, 2020 11:14 AM
    Hi

    with a bit of magic, additional scripting and the command :MODIFY_STATE in post_process this can be done easily :-)

    https://docs.automic.com/documentation/webhelp/english/AA/12.3/DOCU/12.3/Automic%20Automation%20Guides/help.htm#Script/Reference/MODIFY_STATE.htm%3FTocPath%3DReference%7CAutomation%2520Engine%2520Script%2520Reference%7CScript%2520Elements%2520Ordered%2520by%2520Purpose%7CTasks%7C_____14

    cheers, Wolfgang

    ------------------------------
    Support Info:
    if you are using one of the latest version of UC4 / AWA / One Automation please get in contact with Support to open a ticket.
    Otherwise update/upgrade your system and check if the problem still exists.
    ------------------------------



  • 8.  RE: FTP directory testing

    Posted Feb 12, 2020 11:42 AM
    ​Nooooooooooooo! :)

    So sorry Wolfgang but this has been discussed six months ago repeatedly: :MODIFY_STATE is for generating faux return codes from JCL, not for modifying Automic ENDED_NOT_OK into something else. It could be used if he used an external ftp client such as lftp. It's not of any value for RA agent, it can not modify Automic states retroactively.

    *scnr*



  • 9.  RE: FTP directory testing

    Posted Feb 13, 2020 04:57 AM
    Apparently :MODIFY_STATE can be used to modify return codes from RA agent steps in the POST_PROCESSING of an RA job.

    Kudos to @Frank Muffke for figuring that out.



  • 10.  RE: FTP directory testing

    Posted Feb 13, 2020 05:17 AM
    Hello Balint,

    without been tested I would do it this way:

    1. Create a Workflow with two FTP-Jobs
    2. First FTP-Job does a "ls" -> In Post-Script check the report and if the directory is existing -> set a variable to "ok"
    2. Second FTP-Job checks the variable, for example in precondition -> if variable is "ok" -> download the files, else skip the job

    Bernhard

    ------------------------------
    Landeshauptstadt München
    ------------------------------