#!/bin/bash LOG_DIRS=( "/DATA/LOGS/test1" "/DATA/LOGS/test2" ) for target in ${LOG_DIRS[*]} do find $target -type f -mtime +365 -exec rm '{}' \; #find $target -type f -name "server.log*" -mtime +365 -exec rm '{}' \; done