• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 321
  • Last Modified:

Delete files

i need to create a script. and this script can delete all files that contains the word """CORRECTED""""  
and more than """" 14 days"""
file name:
-rw-r--r--   1 moto_sys staff    16126 Feb  4 13:23 'File.J0803100'_CORRECTED_ID001235
-rw-r--r--   1 moto_sys staff    4345 Jan 28 16:05 file.sdfadfe.dat
-rw-r--r--   1 moto_sys staff    16126 Jan 17 18:24 'File.J0123400'_CORRECTED_ID001234

0
moto_sys
Asked:
moto_sys
2 Solutions
 
Kent OlsenData Warehouse Architect / DBACommented:
Hi moto_sys,

find {path} -ctime 1209600 -name "*CORRECTED*" -exec rm {} \;

Note that the -ctime value is exactly 14 days from the current timestamp, and not relative midnight.


Good Luck,
Kent
0
 
TintinCommented:
find /some/dir -name "*CORRECTED*" -mtime +14 | xargs rm
0
 
Suhas .QA ManagerCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup Zone:

Split: Kdo {http:#20840575} & Tintin {http:#20843391}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Suhas
Experts Exchange Cleanup Volunteer
0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now