Command

  • 13 Apr

    Running a python script with Command as source but rule doesn’t end

    Running a python script with Command as source but rule doesn’t end

    Q: I’m trying to setup a rule with a cmd as source, it executes a python script. When I execute the rule, it works well (I have the expected result), but the rule doesn’t end. So, I don’t have any output in the Limagito GUI.

    It seems that the process continues to run :

    20/01/2025 12:08:02 Execute Rule Request from administrator at 192.168.92.38 []

    20/01/2025 12:08:02 Execute Command as Source: [CMD] Command, Command Line: CMD /C python xxx\mediaprint_api_v3.py

    20/01/2025 12:08:02 Set CMD as Source Output to C:\Users\ADMINI~1\AppData\Local\Temp\LimagitoX\LimagitoX.83\

    20/01/2025 12:08:02 Execute M1 Command, Exception Error: Cannot perform this operation when process is running

    20/01/2025 12:08:02 Execute Command as Source Succes, ExitCode : 4294967295, Result Path: C:\Users\ADMINI~1\AppData\Local\Temp\LimagitoX\LimagitoX.83\

    20/01/2025 12:08:07 Rule Disabled by administrator at 192.168.92.38 []

    Should I check an option when configuring the rule to avoid that ?

    A: You are using CMD /C so that part is OK. I guess you need to add something to the python script that will close afterwards.

    ChatGPT info:

    limagito file mover Running a python script

    Customer feedback:

    Indeed, i was trying things and I it ended successfully with a sys.exit(0)

    If you need any help with this ‘Running a python script’ question, please let us know.

    Best Regards,

    Limagito Team

    #python #managedfiletransfer #filetransfer #filemanagement

    By Limagito-Team Command ,
  • 28 Oct

    How to execute script on temp folder

    How to execute script on temp folder

    Q: I would like to change the content of a file located on an FTP. I am trying to do so with a python script executed thanks to command option. So, my source is an FTP, and the destination is the same FTP. Is there a way to execute the command script on the temp folder so it would follow these steps :

    1. Move file from FTP to AppData\Local\Temp…
    2. Execute script on the moved file.
    3. Move the edited file to the same FTP.

    I succeed doing it with 2 rules :

    Rule 1 :

    1. Move file from FTP to a local folder.
    2. Execute script on the moved file.

    Rule 2 :

    1. Move file from local folder to the same FTP.

    Thank you!

    A:  It should be possible in one Rule.

    Your Destination setup will have 2 Destination entries. In my example below the second destination is WIN, in your case it would be FTP.
    In the Command setup you can use parameters like %SFP%SFN
    These parameters will point to the Source file located in the temporary folder after download from FTP as Source.

    limagito file mover script on Temp folder

    It is a good idea to adjust the Function setup. We changed the ‘Destination Options’ to ‘Exit Cyclus on Error’. So if the command in the first entry fails it will not move the file to the FTP server. It will retry the Command during the next scan.

    limagito file mover function exit cyclus on error

    #command #filetransfer #filemanagement

    If you need any help with this ‘execute script on Temp folder’ option, please let us know.

    Best Regards,

    Limagito Team

    By Limagito-Team Command ,
  • 23 Oct

    How to use the new command line tools method

    How to use the new command line tools method

    In version v2023.10.23.0 we added a second method to execute Command Line Tools.

    This second method is available with:

    • CMD as Source
    • CMD as Destination
    • Command option (Moving Rule Menu)

    This new method is also the default in our newly added Rule Events Command option.

    The new Command method has two new options:

    • Max Time After Beginning (seconds): If you want the process to stop by itself after X seconds of activity, use the property ‘Max Time After Beginning’.
    • Max Time After Last Output (seconds): If you want the process to stop after X seconds without an output, use the property ‘Max Time After Last Output’.

    Both options will prevent our File Mover Rule from hanging due to incorrect behavior of the Command Line Tool.

    new command line tools

    RunTime Log Result example:

    limagito file mover runtime log

    #cmd #filetransfer #filemanagement

    If you need any help with this ‘new command line tools’ option, please let us know.

    Best Regards,

    Limagito Team

    By Limagito-Team Command ,
1 2 3 4
SEARCH