Delete files older then n days
n=1 ---- Number of days
filePattern="abc.log.day*" --- Pattern of file
find . -mtime +$n -name "$filePattern" -exec rm {} \; --- Command delete files older then n days
Move files older then n days to directory
dir=
Zip files older then 1 day
find . -mtime +1 -name "fileName*" -exec gzip {} \;
n=1 ---- Number of days
filePattern="abc.log.day*" --- Pattern of file
find . -mtime +$n -name "$filePattern" -exec rm {} \; --- Command delete files older then n days
Move files older then n days to directory
dir=
Zip files older then 1 day
find . -mtime +1 -name "fileName*" -exec gzip {} \;
No comments:
Post a Comment