Usando "find -mtime", ejemplo practico.

2 views
Skip to first unread message

Ricardo de Jesús Pelcastre Cervantes

unread,
Jul 12, 2007, 12:06:21 PM7/12/07
to pozarica
export LOG=c:/tmp/s_neteja.log;

if [ `find /winnt/temp/ -mtime +35 -print | wc -l` -gt 0 ] then
echo Executo c: find /winnt/temp/ -mtime +35 -exec rm - fr {} \; >>$
{LOG}

find /winnt/temp/ -mtime +35 -print >>${LOG}

find /winnt/temp/ -mtime +35 -exec rm -fr {} \;
fi

-
Este script borra de la carpeta /winnt/temp los ficheros que no se han
modificado en 35 dias y los borra (primero escribe que va a borrar el
fichero en un log... por si algun usuario pierde un fichero importante
y demas.

Reply all
Reply to author
Forward
0 new messages