Run System commands

Viewing 5 posts - 1 through 5 (of 5 total)
  • 23rd May 2007 at 12:48 pm #14186

    Hey there.
    I just wondered, if it’s possible to make Muster perform a system command like “copy” or “delete” on a specific machine.
    The task is to move a computed file from a local computer to a network folder after it’s created in Maya via Muster.
    So the workflow would be like:
    1. Render the data file in Maya on one machine
    2. Copy the generated file from the local computer to a server
    3. Use the copied file for a new rendering

    I know that it’s possible to set dependencies for jobs, so the main question is how to run system commands as a job via the Muster Submission Panel.
    Any advices are welcome!

    Thanks,

    Markus

    25th May 2007 at 6:44 pm #14676

    You’ve to write a new template.
    the easiest way to perform what you’re asking for is running a batch file (.cmd).

    To run batch files, you’ve invoke the windows cmd.exe command line utility.

    If you step inside the template folder of your installation, you’ll find an example folder with a template able to launch a chkdsk. You may modify that one to meet your needs.

    regards

    Leonardo.

    29th May 2007 at 2:13 pm #14679

    Thanks for your answer. So here is my template:



    # JDL – Job Description language
    # Template file for Muster 5.0, applies to Maya 7.0+ supported engines
    #
    # Basic template declaration, specify job string identifier and unique ID

    DECLARE TEMPLATE
    {

    SET TEMPLATE_NAME “Windows Command”
    SET TEMPLATE_DESC “Perform a windows command”
    SET TEMPLATE_UID 999
    SET TEMPLATE_LOGIC SINGLE
    SET DEFAULT_PRIORITY 1
    SET DEFAULT_POOL “Entire Farm”
    SET MAXIMUM_LICENSES 0
    }

    DECLARE SINGLE
    {

    }

    DECLARE SUBMISSION
    {
    SET ENABLE_ADDITIONAL_FLAGS 0
    ADD THECOMMAND STRING_INPUT “String” “Full Command” ACTIVABLE MANDATORY
    }

    DECLARE ENGINE_WIN
    {
    SET PLATFORM_ENABLED 1
    SET ENABLE_ERROR_CHECK 1
    SET ENABLED_BY_DEFAULT 1
    SET COMMAND_LINE “/c %ATTR(THECOMMAND)”
    SET EXECUTABLE “%ATTR(CMDEXECUTABLE)”
    SET STARTING_FOLDER “c:\”
    SET ENVIRONMENT_BLOCK USER
    SET DETECTION_LOGIC REALPROC

    DECLARE CONFIGURABLE_TAGS
    {
    ADD CMDEXECUTABLE FILE_SELECTOR “c:windowssytem32cmd.exe” “NT Cmd executable” “Specify the NT Cmd executable” NOTACTIVABLE MANDATORY *.exe

    }

    DECLARE CUSTOM_ENVIRONMENT
    {

    }
    }

    DECLARE ENGINE_MAC
    {
    SET PLATFORM_ENABLED 0
    SET ENABLED_BY_DEFAULT 0
    }

    DECLARE ENGINE_LINUX
    {
    SET PLATFORM_ENABLED 0
    SET ENABLED_BY_DEFAULT 0
    }

    DECLARE ERROR
    {
    ADD WARNING “Warning” “Warn”
    ADD ERROR “Error”
    ADD DEFAULT_RETCODE 0
    }



    Works well for me now.
    Just type a usual windows command line like copy c:copyfile.txt c:copyfolder in the “Full Command” box and enter the correct IP for the machine that should perform the command.

    Markus

    29th May 2007 at 10:41 pm #14681

    You’re using the /k flag, this means, from Microsoft help:

    Executes the command and stay

    Basically the command is executed but the cmd.exe process stay alive, that’s why Muster is stuck with “Job in progress…”

    You should check the /k with the /c flag, that means: Execute the command then terminate.

    So:

    SET COMMAND_LINE “/k %ATTR(THECOMMAND)”

    should be:

    SET COMMAND_LINE “/c %ATTR(THECOMMAND)”

    Hope this helps.

    29th May 2007 at 10:52 pm #14680

    Yeah, this was exactly the problem. I just figured it out, while you were writig.

    Thanks,

    markus

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.