Last active
December 21, 2015 13:48
-
-
Save gabrielkfr/6314901 to your computer and use it in GitHub Desktop.
Script para eliminar archivos por antigüedad.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Variables | |
# OBS VARIABLE FILES_LIFE_TIME: Cuando el valor es 1, los archivos a | |
# ser eliminados son los que tienen una antiguedad mayor a 48 horas, | |
# si el valor de la variable es 2, los archivos que seran eliminados | |
# seran aquellos con una antiguedad mayor a 72 horas, y si por ejemplo | |
# el valor de la variable es cero 0, los archivos eliminados seran | |
# aquellos cuya antiguedad sea mayor a 24 horas en existencia. | |
PATH_ARCHIVES_LOCAL=/backups | |
FILES_LIFE_TIME=2 | |
# Ejecucion del comando de limpieza | |
find $PATH_ARCHIVES_LOCAL/*.arc -mtime +$FILES_LIFE_TIME -exec rm {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment