diff options
author | irina <irinagomez@us.es> | 2014-03-17 13:50:36 +0000 |
---|---|---|
committer | irina <irinagomez@us.es> | 2014-03-17 13:50:36 +0000 |
commit | 251c9e4f84eeeb86d015df4d76d45ebe3a36d189 (patch) | |
tree | 50cc8ba02b993b974d8756f0ea32ae393a064917 /client/shared/scripts/restoreDiffImage | |
parent | 1f03f6e1e23f42a55bfaffcdd63852be4562866e (diff) |
#636 #565 mensajes log en tiempo real y corrige problema al crear imágenes sincronizada tipo archivo con cliente en modo usuario
git-svn-id: https://opengnsys.es/svn/branches/version1.0@4189 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'client/shared/scripts/restoreDiffImage')
-rwxr-xr-x | client/shared/scripts/restoreDiffImage | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/client/shared/scripts/restoreDiffImage b/client/shared/scripts/restoreDiffImage index 157fe9a5..54edc045 100755 --- a/client/shared/scripts/restoreDiffImage +++ b/client/shared/scripts/restoreDiffImage @@ -52,26 +52,26 @@ if [ "$*" == "help" ]; then exit 0 fi -[ $# -lt 5 ] && exit $(ogRaiseError $OG_ERR_FORMAT "$MSG_FORMAT: $PROG REPO|CACHE base_image diff_imagen ndisco nparticion [ UNICAST|MULTICAST|TORRENT ] [opciones protocolo]"; echo $?) +[ $# -lt 5 ] && exit $(ogRaiseError session $OG_ERR_FORMAT "$MSG_FORMAT: $PROG REPO|CACHE base_image diff_imagen ndisco nparticion [ UNICAST|MULTICAST|TORRENT ] [opciones protocolo]"; echo $?) -echo "[1] $MSG_SCRIPTS_START $0 $*" | tee -a $OGLOGFILE $OGLOGSESSION +ogEcho log session "[1] $MSG_SCRIPTS_START $0 $*" # Procesar parámetros de entrada DIFFTYPE="diff" DIFFEXT="img.diff" -REPODIFFFILE="$(ogGetPath "REPO" "$3.$DIFFEXT")" || exit $(ogRaiseError $OG_ERR_NOTFOUND "REPO $3.$DIFFEXT";echo $?) +REPODIFFFILE="$(ogGetPath "REPO" "$3.$DIFFEXT")" || exit $(ogRaiseError session $OG_ERR_NOTFOUND "REPO $3.$DIFFEXT";echo $?) # Comprobamos si la imagen o la particion estan bloqueada: -ogIsImageLocked "$1" "$3.$DIFFEXT" && exit $(ogRaiseError $OG_ERR_LOCKED "$1 $3.$DIFFEXT";echo $?) -ogIsLocked "$4" "$5" && exit $(ogRaiseError $OG_ERR_LOCKED "$4 $5";echo $?) +ogIsImageLocked "$1" "$3.$DIFFEXT" && exit $(ogRaiseError session $OG_ERR_LOCKED "$1 $3.$DIFFEXT";echo $?) +ogIsLocked "$4" "$5" && exit $(ogRaiseError session $OG_ERR_LOCKED "$4 $5";echo $?) -PART=$(ogDiskToDev "$4" "$5" 2>/dev/null ) || exit $(ogRaiseError $OG_ERR_PARTITION "$1 $3";echo $?) +PART=$(ogDiskToDev "$4" "$5" 2>/dev/null ) || exit $(ogRaiseError session $OG_ERR_PARTITION "$1 $3";echo $?) # Carga del configurador del engine [ -z $OGENGINECONFIGURATE ] && source /opt/opengnsys/etc/engine.cfg # Comprobar que es sincronizable -ogIsSyncImage REPO "$3" diff || exit $(ogRaiseError $OG_ERR_DONTSYNC_IMAGE "$1 $3";echo $?) +ogIsSyncImage REPO "$3" diff || exit $(ogRaiseError session $OG_ERR_DONTSYNC_IMAGE "$1 $3";echo $?) # Restauramos la imagen Basica. restoreBaseImage $1 "$2" "$4" "$5" "$6" "$7" @@ -79,35 +79,35 @@ restoreBaseImage $1 "$2" "$4" "$5" "$6" "$7" PROTO=${6:-"UNICAST"} if [ "$1" == "CACHE" -o "$1" == "cache" ]; then - echo "[10] $MSG_HELP_updateCache." | tee -a $OGLOGFILE $OGLOGSESSION - echo " updateCache REPO" "/$3.$DIFFEXT" "$PROTO" "$7" | tee -a $OGLOGFILE $OGLOGSESSION + ogEcho log session "[10] $MSG_HELP_updateCache." + ogEcho log session " updateCache REPO" "/$3.$DIFFEXT" "$PROTO" "$7" updateCache REPO "/$3.$DIFFEXT" "$PROTO" "$7" RETVAL=$? if [ "$RETVAL" != "0" ] then - echo "[39] $MSG_SCRIPTS_TASK_END updateCache REPO $3.$DIFFEXT $6 $7 con error $RETVAL" | tee -a $OGLOGFILE + ogEcho log session "[39] $MSG_SCRIPTS_TASK_END updateCache REPO $3.$DIFFEXT $6 $7 con error $RETVAL" # RC=15 No hay cache # RC=16 no hay espacio sufiente exit $RETVAL fi TIMEAUX1=$[SECONDS-TIME] - echo " $MSG_SCRIPTS_TASK_END, $MSG_SCRIPTS_TIME_PARTIAL : $[TIMEAUX1/60]m $[TIMEAUX1%60]s" | tee -a $OGLOGFILE $OGLOGSESSION + ogEcho log session " $MSG_SCRIPTS_TASK_END, $MSG_SCRIPTS_TIME_PARTIAL : $[TIMEAUX1/60]m $[TIMEAUX1%60]s" fi TIME2=$SECONDS # Restaurar la imagen. -echo "[40] $MSG_RESTORE $PART" | tee -a $OGLOGFILE $OGLOGSESSION +ogEcho log session "[40] $MSG_RESTORE $PART" # Montamos la diferencial ogMountImage "$1" "$3" "$DIFFTYPE" &>/dev/null # Comprobar que la imagen diferencial se ha montado -ogWaitMountImage "$1" "$3" "$DIFFTYPE" || exit $(ogRaiseError $OG_ERR_DONTMOUNT_IMAGE "$1 $3 $DIFFTYPE: time_out $TIMEAUX seg.";echo $?) +ogWaitMountImage "$1" "$3" "$DIFFTYPE" || exit $(ogRaiseError session $OG_ERR_DONTMOUNT_IMAGE "$1 $3 $DIFFTYPE: time_out $TIMEAUX seg.";echo $?) ogMount $4 $5 >/dev/null ogLock $4 $5 # Sincronizamos la partición con la imagen. -echo "[60] $MSG_HELP_ogSyncRestore: $1 $3 $DIFFTYPE $4 $5" |tee -a $OGLOGFILE $OGLOGSESSION +ogEcho log session "[60] $MSG_HELP_ogSyncRestore: $1 $3 $DIFFTYPE $4 $5" ogSyncRestore "$1" "$3" "$DIFFTYPE" $4 $5 # Desmontamos la imagen @@ -115,16 +115,16 @@ ogUnmountImage "$1" "$3" "$DIFFTYPE" ogUnlock $4 $5 TIMEAUX2=$[SECONDS-TIME2] -echo " $MSG_SCRIPTS_TASK_END, $MSG_SCRIPTS_TIME_PARTIAL : $[TIMEAUX2/60]m $[TIMEAUX2%60]s" | tee -a $OGLOGFILE $OGLOGSESSION +ogEcho log session " $MSG_SCRIPTS_TASK_END, $MSG_SCRIPTS_TIME_PARTIAL : $[TIMEAUX2/60]m $[TIMEAUX2%60]s" # creando enlaces y restableciendo ACL (en windows) -echo "[70] $MSG_HELP_ogRestoreInfoImage" |tee -a $OGLOGFILE $OGLOGSESSION +ogEcho log session "[70] $MSG_HELP_ogRestoreInfoImage" ogRestoreInfoImage "$4" "$5" &>$OGLOGCOMMAND # Llamar al script de post-configuración del sistema operativo. -echo "[90] $MSG_HELP_configureOs." | tee -a $OGLOGFILE $OGLOGSESSION +ogEcho log session "[90] $MSG_HELP_configureOs." configureOs $4 $5 TIME=$[SECONDS-TIME1] -echo "[100] $MSG_SCRIPTS_END $MSG_SCRIPTS_TIME_TOTAL: $[TIME/60]m $[TIME%60]s" |tee -a $OGLOGFILE $OGLOGSESSION +ogEcho log session "[100] $MSG_SCRIPTS_END $MSG_SCRIPTS_TIME_TOTAL: $[TIME/60]m $[TIME%60]s" |