diff options
author | irina <irinagomez@us.es> | 2014-04-04 12:42:32 +0000 |
---|---|---|
committer | irina <irinagomez@us.es> | 2014-04-04 12:42:32 +0000 |
commit | c4db9c18ec5b148dd67bb452af35b515f8c59e23 (patch) | |
tree | d4e79784d34cf5b3f3e33bb9c50a4e0eaf101462 | |
parent | 006e950a2e2fe7fba70c674c74c1521e2bd99d37 (diff) |
#565 Se crea codigo y mensaje de error para los problemas de transferencia de rsync.
git-svn-id: https://opengnsys.es/svn/branches/version1.0@4220 a21b9725-9963-47de-94b9-378ad31fedc9
-rw-r--r-- | admin/Sources/Clients/ogAdmClient/sources/ogAdmClient.h | 3 | ||||
-rwxr-xr-x | client/engine/Rsync.lib | 4 | ||||
-rwxr-xr-x | client/engine/System.lib | 1 | ||||
-rw-r--r-- | client/shared/etc/lang.ca_ES.conf | 1 | ||||
-rw-r--r-- | client/shared/etc/lang.en_GB.conf | 1 | ||||
-rw-r--r-- | client/shared/etc/lang.es_ES.conf | 1 | ||||
-rwxr-xr-x | client/shared/etc/preinit/loadenviron.sh | 1 | ||||
-rwxr-xr-x | client/shared/scripts/createBaseImage | 8 | ||||
-rwxr-xr-x | client/shared/scripts/createDiffImage | 6 | ||||
-rwxr-xr-x | client/shared/scripts/restoreBaseImage | 5 | ||||
-rwxr-xr-x | client/shared/scripts/restoreDiffImage | 6 |
11 files changed, 30 insertions, 7 deletions
diff --git a/admin/Sources/Clients/ogAdmClient/sources/ogAdmClient.h b/admin/Sources/Clients/ogAdmClient/sources/ogAdmClient.h index d1794c47..357059fa 100644 --- a/admin/Sources/Clients/ogAdmClient/sources/ogAdmClient.h +++ b/admin/Sources/Clients/ogAdmClient/sources/ogAdmClient.h @@ -130,9 +130,10 @@ char* tbErroresScripts[]={"Se han generado errores desconocidos. No se puede con "071-Imagen no sincronizable (es monolitica).",\ "072-Error al desmontar la imagen.",\ "073-No se detectan diferencias entre la imagen basica y la particion.",\ + "074-Error al sincronizar, puede afectar la creacion/restauracion de la imagen.",\ "Error desconocido " }; - #define MAXERRORSCRIPT 73 // Error máximo cometido + #define MAXERRORSCRIPT 74 // Error máximo cometido // ________________________________________________________________________________________________________ // Prototipo de funciones // ________________________________________________________________________________________________________ diff --git a/client/engine/Rsync.lib b/client/engine/Rsync.lib index 2a5472e0..a68af442 100755 --- a/client/engine/Rsync.lib +++ b/client/engine/Rsync.lib @@ -356,7 +356,7 @@ function ogSyncCreate () { #@param 4 Nombre Imagen #@param 5 Tipo imagen [ img | diff ] #*/ -local ORIG DIRAUX DIRMOUNT DESTRSYNC USERRSYNC PASSWORD OPTRSYNC +local ORIG DIRAUX DIRMOUNT DESTRSYNC USERRSYNC PASSWORD OPTRSYNC RETVAL # Limpiamos los archivo de log echo "" >$OGLOGCOMMAND; @@ -800,7 +800,7 @@ file "$IMGFILE" | grep -i -e " BTRFS Filesystem " -e " ext4 filesystem " >/dev/n #@exception OG_ERR_NOTFOUND # 2 Fichero o dispositivo no encontrado. #*/ ogCheckSyncImage (){ -local IMGEXT IMGDIR IMGFILE DIRMOUNT +local IMGEXT IMGDIR IMGFILE DIRMOUNT RETVAL if [ "$*" == "help" ]; then ogHelp "$FUNCNAME": "$MSG_HELP_ogCheckSyncImage" \ diff --git a/client/engine/System.lib b/client/engine/System.lib index e652d3cb..51365902 100755 --- a/client/engine/System.lib +++ b/client/engine/System.lib @@ -125,6 +125,7 @@ case "$CODE" in $OG_ERR_DONTUNMOUNT_IMAGE) MSG="$MSG_ERR_DONTUNMOUNT_IMAGE \"$2\"" ;; $OG_ERR_DONTSYNC_IMAGE) MSG="$MSG_ERR_DONTSYNC_IMAGE \"$2\"" ;; $OG_ERR_NOTDIFFERENT) MSG="$MSG_ERR_NOTDIFFERENT \"$2\"" ;; + $OG_ERR_SYNCHRONIZING) MSG="$MSG_ERR_SYNCHRONIZING \"$2\"" ;; *) MSG="$MSG_ERR_GENERIC"; CODE=$OG_ERR_GENERIC ;; esac diff --git a/client/shared/etc/lang.ca_ES.conf b/client/shared/etc/lang.ca_ES.conf index 6b59fdf8..789eae76 100644 --- a/client/shared/etc/lang.ca_ES.conf +++ b/client/shared/etc/lang.ca_ES.conf @@ -35,6 +35,7 @@ MSG_ERR_DONTMOUNT_IMAGE="Error al montar la imagen" MSG_ERR_DONTUNMOUNT_IMAGE="Error al desmontar la imagen" MSG_ERR_DONTSYNC_IMAGE="Imagen no sincronizable" MSG_ERR_NOTDIFFERENT="No se detectan diferencias entre la imagen basica y la particion." +MSG_ERR_SYNCHRONIZING="Error al sincronizar, puede afectar la creacion|restauracion de la imagen" # Mensajes de avisos. MSG_DONTMOUNT="Sistema de archivos no montado" diff --git a/client/shared/etc/lang.en_GB.conf b/client/shared/etc/lang.en_GB.conf index dd8371a8..d26b90cd 100644 --- a/client/shared/etc/lang.en_GB.conf +++ b/client/shared/etc/lang.en_GB.conf @@ -35,6 +35,7 @@ MSG_ERR_DONTMOUNT_IMAGE="Failed to mount image" MSG_ERR_DONTUNMOUNT_IMAGE="Failed to unmount image" MSG_ERR_DONTSYNC_IMAGE="Not synchronized image" MSG_ERR_NOTDIFFERENT="No differences were detected between the basic image and partition" +MSG_ERR_SYNCHRONIZING="Error al sincronizar, puede afectar la creacion|restauracion de la imagen" # Warning messages. MSG_DONTMOUNT="Unmounted filesystem" diff --git a/client/shared/etc/lang.es_ES.conf b/client/shared/etc/lang.es_ES.conf index 2eab432c..b8a95c2d 100644 --- a/client/shared/etc/lang.es_ES.conf +++ b/client/shared/etc/lang.es_ES.conf @@ -35,6 +35,7 @@ MSG_ERR_DONTMOUNT_IMAGE="Error al montar la imagen" MSG_ERR_DONTUNMOUNT_IMAGE="Error al desmontar la imagen" MSG_ERR_DONTSYNC_IMAGE="Imagen no sincronizable" MSG_ERR_NOTDIFFERENT="No se detectan diferencias entre la imagen básica y la partición" +MSG_ERR_SYNCHRONIZING="Error al sincronizar, puede afectar la creacion|restauracion de la imagen" # Mensajes de avisos. MSG_DONTMOUNT="Sistema de archivos no montado" diff --git a/client/shared/etc/preinit/loadenviron.sh b/client/shared/etc/preinit/loadenviron.sh index a58bfdde..80cbacf5 100755 --- a/client/shared/etc/preinit/loadenviron.sh +++ b/client/shared/etc/preinit/loadenviron.sh @@ -124,3 +124,4 @@ export OG_ERR_DONTMOUNT_IMAGE=70 # Error al montar una imagen sincronizada. export OG_ERR_DONTSYNC_IMAGE=71 # Imagen no sincronizable (es monolitica) export OG_ERR_DONTUNMOUNT_IMAGE=72 # Error al desmontar la imagen export OG_ERR_NOTDIFFERENT=73 # No se detectan diferencias entre la imagen basica y la particion. +export OG_ERR_SYNCHRONIZING=74 # Error al sincronizar, puede afectar la creacion/restauracion de la imagen diff --git a/client/shared/scripts/createBaseImage b/client/shared/scripts/createBaseImage index 9a4fe8bd..b3b3b4b1 100755 --- a/client/shared/scripts/createBaseImage +++ b/client/shared/scripts/createBaseImage @@ -133,8 +133,10 @@ TIME2=$SECONDS if [ "$3" == "CACHE" -o "$3" == "cache" ]; then ogLockImage "$3" "/$4.$IMGEXT" else + ogEcho log session "hose $REPOIP 2009 --out sh -c echo -ne LOCK_IMAGE $4.$IMGEXT" hose $REPOIP 2009 --out sh -c "echo -ne LOCK_IMAGE \"$4.$IMGEXT\" " fi +exit ogEcho log session "[40] $MSG_HELP_ogCreateImage $1 $2 $3 $4 " # Si existe el fichero de la imagen se hace copia de seguridad y se redimensiona, si no existe se crea. @@ -154,7 +156,8 @@ ogWaitMountImage "$3" "$4" $IMGEXT $SIZEREQUIRED || exit $(ogRaiseError session # Sincronizamos los datos de la particion con la imagen. ogEcho log session "[70] $MSG_HELP_ogSyncCreate." ogSyncCreate $1 $2 $3 "$4" $IMGEXT -[ $? == 0 ] || ogEcho session warning "$MSG_ERR_SYNCHRONIZING" +RETVAL=$? +[ $RETVAL == 0 ] || ogEcho session warning "$MSG_ERR_SYNCHRONIZING" TIMEAUX5=$[SECONDS-TIMEAUX3] ogEcho log session " $MSG_SCRIPTS_TASK_END, $MSG_SCRIPTS_TIME_PARTIAL: $[TIMEAUX5/60]m $[TIMEAUX5%60]s" @@ -175,3 +178,6 @@ IMGSIZE=$(ls -l --block-size=1024 "$IMGFILE" | cut -f5 -d" ") TIME=$[SECONDS-TIME1] ogEcho log session "[100] $MSG_SCRIPTS_TIME_TOTAL $[TIME/60]m $[TIME%60]s" ogEcho log session " FileSystem $PART with $SIZEDATA KB data created onto file-image as $4 and used $IMGSIZE KB acros DFS rsync " + +# Si ha habido problema al sincronizar nos salimos con error +[ $RETVAL == 0 ] || exit $OG_ERR_SYNCHRONIZING diff --git a/client/shared/scripts/createDiffImage b/client/shared/scripts/createDiffImage index 8d7ed20b..73ac893c 100755 --- a/client/shared/scripts/createDiffImage +++ b/client/shared/scripts/createDiffImage @@ -195,7 +195,8 @@ ogWaitMountImage "$3" "$5" "$DIFFTYPE" $SIZEREQUIRED || exit $(ogRaiseError ses ogEcho log session "[70] $MSG_HELP_ogSyncCreate" # Copio los datos a la imagen diferecial : ogSyncCreate $1 $2 $3 "$5" $DIFFTYPE -[ $? == 0 ] || ogEcho session warning "$MSG_ERR_SYNCHRONIZING" +RETVAL=$? +[ $RETVAL == 0 ] || ogEcho session warning "$MSG_ERR_SYNCHRONIZING" TIMEAUX6=$[SECONDS-TIMEAUX5] ogEcho log session " $MSG_SCRIPTS_TASK_END, $MSG_SCRIPTS_TIME_PARTIAL: $[TIMEAUX6/60]m $[TIMEAUX6%60]s" @@ -214,3 +215,6 @@ IMGSIZE=$(ls -l --block-size=1024 "${DIFFFILE}"| cut -f5 -d" ") TIME=$[SECONDS-TIME1] ogEcho log session "[100] $MSG_SCRIPTS_TIME_TOTAL $[TIME/60]m $[TIME%60]s" ogEcho log session " FileSystem $PART with $SIZEDATA KB data created onto file-image as $5 and used $IMGSIZE KB acros DFS rsync " + +# Si ha habido problema al sincronizar nos salimos con error +[ $RETVAL == 0 ] || exit $OG_ERR_SYNCHRONIZING diff --git a/client/shared/scripts/restoreBaseImage b/client/shared/scripts/restoreBaseImage index b56ad05e..9d8fd1be 100755 --- a/client/shared/scripts/restoreBaseImage +++ b/client/shared/scripts/restoreBaseImage @@ -122,7 +122,8 @@ ogWaitMountImage "$1" "$2" "$IMGEXT" || exit $(ogRaiseError session $OG_ERR_DON # Sincronizamos la partición con la imagen. ogEcho log session "[60] $MSG_HELP_ogSyncRestore: $1 $2 $IMGEXT $3 $4" ogSyncRestore "$1" "$2" "$IMGEXT" $3 $4 -[ $? == 0 ] || ogEcho session warning "$MSG_ERR_SYNCHRONIZING" +RETVAL=$? +[ $RETVAL == 0 ] || ogEcho session warning "$MSG_ERR_SYNCHRONIZING" TIMEAUX2=$[SECONDS-TIME2] ogEcho log session " $MSG_SCRIPTS_TASK_END, $MSG_SCRIPTS_TIME_PARTIAL : $[TIMEAUX2/60]m $[TIMEAUX2%60]s" @@ -145,3 +146,5 @@ fi TIME=$[SECONDS-TIME1] ogEcho log session "[100] $MSG_SCRIPTS_END $MSG_SCRIPTS_TIME_TOTAL: $[TIME/60]m $[TIME%60]s" +# Si ha habido problema al sincronizar nos salimos con error +[ $RETVAL == 0 ] || exit $OG_ERR_SYNCHRONIZING diff --git a/client/shared/scripts/restoreDiffImage b/client/shared/scripts/restoreDiffImage index 604e72c1..64ed388d 100755 --- a/client/shared/scripts/restoreDiffImage +++ b/client/shared/scripts/restoreDiffImage @@ -109,7 +109,8 @@ ogLock $4 $5 # Sincronizamos la partición con la imagen. ogEcho log session "[60] $MSG_HELP_ogSyncRestore: $1 $3 $DIFFTYPE $4 $5" ogSyncRestore "$1" "$3" "$DIFFTYPE" $4 $5 -[ $? == 0 ] || ogEcho session warning "$MSG_ERR_SYNCHRONIZING" +RETVAL=$? +[ $RETVAL == 0 ] || ogEcho session warning "$MSG_ERR_SYNCHRONIZING" # Desmontamos la imagen ogUnmountImage "$1" "$3" "$DIFFTYPE" @@ -129,3 +130,6 @@ configureOs $4 $5 TIME=$[SECONDS-TIME1] ogEcho log session "[100] $MSG_SCRIPTS_END $MSG_SCRIPTS_TIME_TOTAL: $[TIME/60]m $[TIME%60]s" +# Si ha habido problema al sincronizar nos salimos con error +[ $RETVAL == 0 ] || exit $OG_ERR_SYNCHRONIZING + |