diff options
author | albertogp <albertogp@uma.es> | 2014-04-22 09:51:04 +0000 |
---|---|---|
committer | albertogp <albertogp@uma.es> | 2014-04-22 09:51:04 +0000 |
commit | 4a51c8baee9985b63c3a75e8c65e974228486323 (patch) | |
tree | a5ca64633d38ba6597f6b2e4d2f18ccbfccfa27d /repoman/bin/deletepreimage | |
parent | c8bbcdc04f2c3960623c414552dbd1450451b162 (diff) |
branches-version1.0
Integrando cambios en version 1.0
#462
git-svn-id: https://opengnsys.es/svn/branches/version1.0@4244 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'repoman/bin/deletepreimage')
-rwxr-xr-x | repoman/bin/deletepreimage | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/repoman/bin/deletepreimage b/repoman/bin/deletepreimage index fbaa233e..076ae8e8 100755 --- a/repoman/bin/deletepreimage +++ b/repoman/bin/deletepreimage @@ -29,9 +29,34 @@ mv /opt/opengnsys/www/tmp/*.* /opt/opengnsys/images/ ls /opt/opengnsys/images/*.delete &>/dev/null || exit for IMG in `ls /opt/opengnsys/images/*.delete`; do + ## Obtenemos el nombre de la imagen DELETEIMAGE=$(echo $IMG | awk -F"." '{print $1}' | awk -F"/opt/opengnsys/images/" '{print $2}') + # Borramos marca .delete para que el proximo cron no trabaje sobre este conjunto. [ -f $IMG ] && rm $IMG + + ## Comprobamos si es un Directorio .delete + DELETEdir=$(echo $IMG | awk -F"." '{print $2}') ## .delete + DELETEant=$(echo $IMG | awk -F"." '{print $3}') ## .ant + DELETEdiff=$(echo $IMG | awk -F"." '{print $3}') ## .diff + ## Si NO es ninguno es un img + ## se llama al escript de borrado de imagen. - /opt/opengnsys/bin/deleteimage $DELETEIMAGE + ## Si es un Directorio Borramos + if [[ $DELETEdir == "delete" ]]; then + /opt/opengnsys/bin/deleteimage $DELETEIMAGE d + + # Si es un Imagen Backup Borramos + elif [[ $DELETEant == "ant" ]]; then + DELETEIMAGE=$DELETEIMAGE".ant" + /opt/opengnsys/bin/deleteimage $DELETEIMAGE + + # Si es un Imagen diff Borramos + elif [[ $DELETEdiff == "diff" ]]; then + /opt/opengnsys/bin/deleteimage $DELETEIMAGE + + # Si no es una de las anteriores lo que queda es img + else + /opt/opengnsys/bin/deleteimage $DELETEIMAGE + fi done
\ No newline at end of file |