« Home | Acceso remoto » | Street Fighter The later years » | Trafico de vacaciones » | Mensajes Gratis a Celular » | Borrado Masivo PLSQL » | Tihany en MTY » | BSOD Saver » | CURP » | Safe Drive » | Quien te ha eliminado del MSN » 

lunes, enero 08, 2007

Borrado Masivo Unix

Siguiendo con el tema de los 'Borrados Masivos', ahora me toco hacer uno en un ambiente POSIX, el punto era aqui decirle al SO, que el borrado deberia ser por cierta fecha...para acortarles la historia... el buen Quique me ayudo y este es el script para borrar:

1)Primero tendras que correr esta linea segun los parametros que utilizar
find . -name "*stream*" -mtime +09 -print > borrar.txt
^ ^

Cuantos dias hacia atras vaz a borrar
Es es el parametro

2) Se crea un Shell con el siguiente script:
vi nombre_del_archivo.shInsertar la 5 lineas a continuacion
for i in `cat borrar.txt`
do rm $i
done
rm borrar.txt

3) Despues darle permisos al shell chmod 777 nombre_del_archivo.sh

Y ejecutar el shell

Etiquetas: ,

E-mail this post



Remember me (?)



All personal information that you provide here will be governed by the Privacy Policy of Blogger.com. More...

Add a comment

 

About me

  • I'm CVN
  • From Mexico

My profile

Archives

    www.flickr.com
    This is a Flickr badge showing public photos from CVN. Make your own badge here.