Reputation: 109
I am trying to copy files from a parent directory which contain multiple sub directories. The required file Tree structure is below:
MachineLogs/XXXXX/*_CORE.txt
MachineLogs/YYYYY/*_CORE.txt
I am using the following code for selecting and copying required files:
from "$localLogsDir/CoreLogsUos1"
include '*/*_CORE_*.*'
into new File(analysisChainDir, 'CORE')
includeEmptyDirs = false
exclude { details -> details.file.isDirectory()}
The above snippet is copying the CORE files correctly but it is also copying the directory in which they are present. I can not name the sub-directories as they are created dynamically according to present date.
Upvotes: 1
Views: 917