Welcome! Log In Create A New Profile

Advanced

Run System commands

Posted by Markus 
Run System commands
May 23, 2007 02:48PM
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
Re: Run System commands
May 25, 2007 08:44PM
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.
Re: Run System commands
May 29, 2007 04:13PM
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:\windows\sytem32\cmd.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



Edited 4 time(s). Last edit at 05/30/2007 12:44AM by Markus.
Re: Run System commands
May 30, 2007 12:41AM
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.
Re: Run System commands
May 30, 2007 12:52AM
Yeah, this was exactly the problem. I just figured it out, while you were writig.

Thanks,

markus
Sorry, only registered users may post in this forum.

Click here to login