bash - Deleting files older than 10 days in wildcard directory loop -
i delete old files multiple directories there wild card 1 of path attributes. i'm trying loop through each of directories without specifying each one. think i'm there i'm not sure how cd specific directory delete relevant files.
#! /bin/bash delete_search_dir=/apps/super/userprojects/elasticsearch/v131/node*/elasticsearch-1.3.1/logs/ entry in `ls $delete_search_dir`; find $path -name "*super*" -type f -mtime +10 -print -delete #find . -type f -name $entry -exec rm -f {} \; done
any ideas on how specific directory , apply delete?
find
can search in multiple directories. can this:
delete_search_dir=/apps/super/userprojects/elasticsearch/v131/node*/elasticsearch-1.3.1/logs find $delete_search_dir -type f -name '*super*' -mtime +10 -print -delete
Comments
Post a Comment