summaryrefslogtreecommitdiffstats
path: root/client/engine/Rsync.lib
diff options
context:
space:
mode:
authoririna <irinagomez@us.es>2014-07-31 11:02:19 +0000
committeririna <irinagomez@us.es>2014-07-31 11:02:19 +0000
commitd34255f08fd2c131e872a3d8aa2c9c05987d9c7c (patch)
treebca3d8fa57a07dfc6c04d754b8d18f178f11e944 /client/engine/Rsync.lib
parent3dc839680dbef722ebbf8976fb2d64540bc03e74 (diff)
#657 ogReduceImagen: para ogclient 1.0.5 (BTRFS) desmonta la imagen
git-svn-id: https://opengnsys.es/svn/branches/version1.0@4351 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'client/engine/Rsync.lib')
-rwxr-xr-xclient/engine/Rsync.lib13
1 files changed, 8 insertions, 5 deletions
diff --git a/client/engine/Rsync.lib b/client/engine/Rsync.lib
index 5b735c5e..bcf1a810 100755
--- a/client/engine/Rsync.lib
+++ b/client/engine/Rsync.lib
@@ -710,10 +710,10 @@ fi
IMGDIR="$(ogGetParentPath "$1" "/$2")"
IMGFILE="${IMGDIR}/$(basename "/$2").$IMGEXT"
-# Solo es posible para imagenes EXT4. Si no es EXT4 salimos sin error
-file "$IMGFILE" | grep -i " ext4 filesystem " 2>&1 > /dev/null || return 0
if [ "$1" == "CACHE" -o "$1" == "cache" ]; then
+ # Para imagenes EXT4 reduzco, para BTRFS solo desmonto.
+ if file "$IMGFILE" | grep -i " ext4 filesystem " 2>&1 > /dev/null; then
# Al montar se comprueba la existencia de la imagen
DIRMOUNT="$(ogMountImage $1 "$2" ${IMGEXT#*\.})"
AVAILABLE=$(df -k|grep "$DIRMOUNT$"|awk '{print $4}')
@@ -748,10 +748,13 @@ if [ "$1" == "CACHE" -o "$1" == "cache" ]; then
# Corto el archivo al tamaƱo del sistema de ficheros.
echo " truncate --size=\"$EXTSIZE\"k $IMGFILE "
truncate --size="$EXTSIZE"k "$IMGFILE"
-
+ else
# Desmonto la imagen
- echo "reduced" > "$IMGFILE.lock"
- rmdir "$DIRMOUNT"
+ umount "$DIRMOUNT"
+ fi
+
+ echo "reduced" > "$IMGFILE.lock"
+ rmdir "$DIRMOUNT"
else
[ -z $REPOIP ] && REPOIP=$(ogGetRepoIp)