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

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -