PLANTA_MODULE
parameter (see here).
<Python Interpreter> <Headless Path>planta_headless.py --service=<Server>:<Port> --user=<BATCH User> --auth_type=challenge --secret=<PW File>
Example Windows
Parameter Description Example Windows Example Linux <Python Interpreter> Opening the corresponding Python interpreters C:\Python27\python.exe /usr/local/bin/python2.7 <Headless path> Directory path headless clients, absolute:
or based on the current directory:C:\PLANTA\Jobs\Headless\
.\/planta/jobs/headless/
./<Server> Name or IP Address of the PLANTA Server localhost (if it is run on an application server)
planta4711.planta.de
10.210.47.11<Port> Service connection port Default is 21000 + System no., e.g. 21001 <BATCH-User> Name of the PLANTA project batch user BATCH <PW-Datei> Path and name of the password file to be created .\auth_file ./auth_file
C:\Python27\python.exe C:\PLANTA\Jobs\Headless\planta_headless.py --service=planta4711:21001 --user=BATCH --auth_type=challenge --secret=C:\PLANTA\Jobs\Headless\auth_fileExample Linux
/usr/local/bin/python2.7 ./planta_headless.py --service=localhost:21210 --user=BATCH --auth_type=challenge --secret=./auth_file
Headless.bat
under Windows or named headless.bsh
under Linux) in the headless cient directory (the date stamp here depends on the local format and must be adjusted if necessary).
@ECHO OFF REM BATCH REM PLANTA headless client: Running batch jobs Adjust REM parameter: REM ---> SET PYTHON="<Path to Python (V. 2.6 or 2.7)>" SET HEADLESS_DIR="<Path to headless client (PLANTA_PY)>" SET SERVICE=<Serveraddress:Port number> SET USER=BATCH REM This parameter remains empty if the work packet is defined as the start module of the batch user REM otherwise the module ID of the module to be run is entered here: SET PLANTA_MODULE= IF NOT "%PLANTA_MODULE%"=="" SET MODULE_PARAM=--module=%PLANTA_MODULE% IF "%PLANTA_MODULE%"=="" SET MODULE_PARAM= REM If logging is required REM and activate the script call with logging and deactivate the one without logging: REM SET LOG_DIR="<Path of the log directory>" REM SET LOGFILE="<Prefix for the log file (e.g. PLANTA_headless)>" REM SET DATETIME=%DATE:~-4%-%DATE:~3,2%-%DATE:~0,2%_%TIME:~0,2%-%TIME:~3,2%-%TIME:~6,2% REM <--- SET AUTH_FILE=".\auth_file" SET PLANTA_PY=".\planta_headless.py" SET PLANTA_SH=%PLANTA_PY% --service=%SERVICE% --user=%USER% --auth_type=challenge --secret=%AUTH_FILE% --module=%PLANTA_MODULE% cd %HEADLESS_DIR% REM variant without logging: %PYTHON% %PLANTA_SH% %* REM variant with logging: REM forfiles -p %LOG_DIR% -m %LOGFILE%*.log -d -7 -c "cmd /c del @path" REM %PYTHON% %PLANTA_SH% %* --timeout=-1 -vvv >> %LOG_DIR%\%LOGFILE%_%DATETIME%_%USER%.log
#!/bin/bash # PLANTA Headless Client: Running batch jobs # Adjust parameter: # ---> PYTHON="<Path to Python (V. 2.6 or 2.7)>" HEADLESS_DIR="<Headless client path (PLANTA_PY)>" SERVICE="<Serveraddress:Portnr.>" USER="BATCH" # If the work packet is defined as the batch user's start module, the following parameter remains empty, # otherwise the module ID of the module to be run is entered: PLANTA_MODULE="" if [[ -z $PLANTA_MODULE ]] then MODULE_PARAM="" else MODULE_PARAM="--module=$PLANTA_MODULE" fi # If logging is required, activate the following variables, # and activate the script call with logging and deactivate the one without logging below: #LOG_DIR="<Log directory path" #LOGFILE="<Prefix for the log file name (e.g. PLANTA_Headless)>" #DATETIME=`date +20%y-%m-%d_%H-%M-%S` # <--- AUTH_FILE="./auth_file" PLANTA_PY="planta_headless.py" PLANTA_SH="./$PLANTA_PY --service=$SERVICE --user=$USER --auth_type=challenge --secret=$AUTH_FILE $MODULE_PARAM" cd $HEADLESS_DIR # Variant without logging: $PYTHON $PLANTA_SH $* # Variant with logging: #find $LOG_DIR -type f -name "$LOGFILE*.log" -mtime +7 -print0 | xargs -0 rm -f #$PYTHON $PLANTA_SH $* --timeout=-1 -vvv >> $LOG_DIR/$LOGFILE\_$DATETIME\_$USER.log
timeout=-1
parameter.