Thursday, September 1, 2011

Script to recursively check a folder and delete files older

#!/bin/bash
Dir="/backup/backup/"
days="30"

find $Dir -type f -mtime +$days -exec rm {} \;


modify days value according to requirement. How old files you want to delete.