#675 funcion ogCleanFs pasa a llamarse ogCleanOs: Se detecta el sistema operativo y se limpian los archivos necesarios.

git-svn-id: https://opengnsys.es/svn/branches/version1.0@4419 a21b9725-9963-47de-94b9-378ad31fedc9
remotes/github/debian-pkg
Irina Gomez 2014-10-31 13:37:32 +00:00
parent 841e5ef9f9
commit 642e39f6bb
2 changed files with 44 additions and 42 deletions

View File

@ -97,48 +97,6 @@ return $ERRCODE
}
#/**
# ogCleanFs int_ndisk int_nfilesys
#@brief Elemina los archivos que no son necesarios en el sistema de archivos.
#@param int_ndisk nº de orden del disco
#@param int_nfilesys nº de orden del sistema de archivos
#@return (nada)
#@exception OG_ERR_FORMAT Formato incorrecto.
#@exception OG_ERR_NOTFOUND Disco o particion no corresponden con un dispositivo.
#@exception OG_ERR_PARTITION Partición desconocida o no accesible.
#@note Antes incluido en la funcion ogReduceFs
#@author Irina Gomez. Universidad de Sevilla.
#@date 2014-10-27
#*/ ##
function ogCleanFs ()
{
# Si se solicita, mostrar ayuda.
if [ "$*" == "help" ]; then
ogHelp "$FUNCNAME" "$FUNCNAME int_ndisk int_nfilesys" \
"$FUNCNAME 1 1"
return
fi
# Error si no se reciben 2 parámetros.
[ $# == 2 ] || ogRaiseError $OG_ERR_FORMAT "$FUNCNAME int_ndisk int_nfilesys" || return $?
case "$(ogGetFsType $1 $2)" in
EXT[234])
# Borramos los ficheros de dispositivos y los temporales.
ogCleanLinuxDevices $1 $2
rm -rf $(ogMount $1 $2)/tmp/*
;;
NTFS)
# Borrar ficheros de hibernación y paginación de Windows.
ogGetPath $1 $2 pagefile.sys &>/dev/null && ogDeleteFile $1 $2 pagefile.sys
ogGetPath $1 $2 hiberfil.sys &>/dev/null && ogDeleteFile $1 $2 hiberfil.sys
ogGetPath $1 $2 swapfile.sys &>/dev/null && ogDeleteFile $1 $2 swapfile.sys
;;
esac
}
#/**
# ogExtendFs int_ndisk int_nfilesys
#@brief Extiende un sistema de archivos al tamaño de su partición.

View File

@ -8,6 +8,50 @@
#@warning License: GNU GPLv3+
#*/
#/**
# ogCleanOs int_ndisk int_nfilesys
#@brief Elimina los archivos que no son necesarios en el sistema operativo.
#@param int_ndisk nº de orden del disco
#@param int_nfilesys nº de orden del sistema de archivos
#@exception OG_ERR_FORMAT Formato incorrecto.
#@exception OG_ERR_NOTFOUND Disco o particion no corresponden con un dispositivo.
#@exception OG_ERR_PARTITION Partición desconocida o no accesible.
#@note Antes incluido en la funcion ogReduceFs
#@author Irina Gomez. Universidad de Sevilla.
#@return (nada)
#@date 2014-10-27
#*/ ##
function ogCleanOs {
# Si se solicita, mostrar ayuda.
if [ "$*" == "help" ]; then
ogHelp "$FUNCNAME" "$FUNCNAME int_ndisk int_nfilesys" \
"$FUNCNAME 1 1"
return
fi
# Error si no se reciben 2 parámetros.
[ $# == 2 ] || ogRaiseError $OG_ERR_FORMAT "$FUNCNAME int_ndisk int_nfilesys" || return $?
case "$(ogGetOsType $1 $2)" in
Linux)
# Borramos los ficheros de dispositivos y los temporales.
ogCleanLinuxDevices $1 $2
rm -rf $(ogMount $1 $2)/tmp/*
;;
Windows)
# Borrar ficheros de hibernación y paginación de Windows.
ogGetPath $1 $2 pagefile.sys &>/dev/null && ogDeleteFile $1 $2 pagefile.sys
ogGetPath $1 $2 hiberfil.sys &>/dev/null && ogDeleteFile $1 $2 hiberfil.sys
ogGetPath $1 $2 swapfile.sys &>/dev/null && ogDeleteFile $1 $2 swapfile.sys
;;
esac
}
#/**
# ogInstallMiniSetup int_ndisk int_npartition str_filename [str_admuser str_admpassword bool_autologin [str_autouser str_autopassword] ]
#@brief Metafunción para instalar archivo que se ejecutará en el arranque de Windows.