diff options
author | ramon <ramongomez@us.es> | 2011-12-22 13:38:11 +0000 |
---|---|---|
committer | ramon <ramongomez@us.es> | 2011-12-22 13:38:11 +0000 |
commit | c3c7cb3ae6f6600223111a572050f34f2df6fa71 (patch) | |
tree | 96fce1db6bf64fee2845d3a48abcbe07d9937562 /admin/Interface/EjecutarScript | |
parent | 4caea352de0d0a19d4e0a2e2dd04980dd28e6be0 (diff) |
Congelar versiĆ³n 1.0.2 en tags/opengnsys-1.0.2 (modifica #446).opengnsys-1.0.2
git-svn-id: https://opengnsys.es/svn/tags/opengnsys-1.0.2@2405 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'admin/Interface/EjecutarScript')
-rwxr-xr-x | admin/Interface/EjecutarScript | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/admin/Interface/EjecutarScript b/admin/Interface/EjecutarScript index 3de64815..431164b9 100755 --- a/admin/Interface/EjecutarScript +++ b/admin/Interface/EjecutarScript @@ -1,21 +1,33 @@ #!/bin/bash +TIME1=$SECONDS -echo -e >> $OGLOGFILE -echo "Contenido de la ejecucion: *****************************" >> $OGLOGFILE +OGLOGSESSION="${OGLOGSESSION=:-/tmp/session.log}" +OGLOGCOMMAND="${OGLOGCOMMAND=:-/tmp/command.log}" + +OGLOGSESSION="/tmp/session.log" +OGLOGCOMMAND="/tmp/command.log" + +echo " " > $OGLOGSESSION +echo " " > $OGLOGCOMMAND +echo " " > ${OGLOGCOMMAND}.tmp + + +echo "START JOBS ***************************** " | tee -a $OGLOGSESSION $OGLOGFILE + +echo "Instrucciones a ejecutar: *****************************" >> $OGLOGFILE cat $1 >> $OGLOGFILE -echo -e >> $OGLOGFILE -echo -e >> $OGLOGFILE -echo "Salida: *****************************" >> $OGLOGFILE + +echo "Salida de las instrucciones: *****************************" >> $OGLOGFILE chmod +x $1 -$1 &>> $OGLOGFILE +$1 &>> $OGLOGCOMMAND RETVAL=$? echo $RETVAL &>> $OGLOGFILE - +TIME=$[SECONDS-TIME1] if [ $RETVAL == 0 ] then - rm $OGLOGFILE - touch $OGLOGFILE + echo "[100] Duracion de la operacion $[TIME/60]m $[TIME%60]s" | tee -a $OGLOGSESSION $OGLOGFILE else - echo $RETVAL &>> $OGLOGFILE + echo "ERROR no operacion no realizada" | tee -a $OGLOGSESSION $OGLOGFILE fi +echo "END JOBS ***************************** " | tee -a $OGLOGSESSION $OGLOGFILE exit $RETVAL
\ No newline at end of file |