source: admin/Interface/EjecutarScript @ 5633342

918-git-images-111dconfigfileconfigure-oglivegit-imageslgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacionwebconsole3
Last change on this file since 5633342 was 4fcbcc8, checked in by irina <irinagomez@…>, 11 years ago

#636 #537 Log en tiempo real. En los script de restauracion los mensajes se envian a session.log y las salidas de los comandos a commad.log. utf-8 en la pagina que muestra los log

git-svn-id: https://opengnsys.es/svn/branches/version1.0@4149 a21b9725-9963-47de-94b9-378ad31fedc9

  • Property mode set to 100755
File size: 1.1 KB
Line 
1#!/bin/bash
2TIME1=$SECONDS
3
4
5#Load engine configurator from engine.cfg file.
6#Carga el configurador del engine desde el fichero engine.cfg
7[ -z $OGENGINECONFIGURATE ] && source /opt/opengnsys/etc/engine.cfg
8
9# Clear temporary file used as log track by httpdlog
10# Limpia los ficheros temporales usados como log de seguimiento para httpdlog
11echo -n "" > $OGLOGSESSION; echo -n  "" > $OGLOGCOMMAND
12
13# Registro de inicio de ejecución
14echo "$MSG_INTERFACE_START $0 $*" | tee -a $OGLOGSESSION $OGLOGFILE
15
16echo -e "\n Instrucciones a ejecutar: *****************************" >>  $OGLOGFILE
17cat  $1 >> $OGLOGFILE
18
19
20echo -e "\n Salida de las instrucciones: *****************************" >>  $OGLOGFILE
21chmod +x $1
22# Si mandamos la salida a OGLOGCOMMAND reescribimos lo que manda el comando.
23#$1 &>> $OGLOGCOMMAND
24$1
25RETVAL=$?
26
27
28
29TIME=$[SECONDS-TIME1]
30if [ $RETVAL == 0 ]
31then
32        echo "[100] Duracion de la operacion $[TIME/60]m $[TIME%60]s" | tee -a $OGLOGSESSION $OGLOGFILE
33else
34        echo "ERROR no operacion no realizada" | tee -a $OGLOGSESSION $OGLOGFILE
35fi
36
37
38# Registro de fin de ejecución
39echo "$MSG_INTERFACE_END $RETVAL" | tee -a $OGLOGSESSION $OGLOGFILE
40
41
42
43exit $RETVAL
Note: See TracBrowser for help on using the repository browser.