Hi,
I am trying to write a script to cleanup files in a log directory ..
cd log
find Datk*[0-9]* -mtime +7 -exec rm -f {} \; 2> /dev/null
Have used the above to clean up files in log directory more then 7 days older.
The file can be something like ( auto-generate by some processes and other scripts )
Datk.010927346
Datk.85132523
If the file is not found in the directory then the code fails on find and errors out.
I dont want to code to error out, instead i want it to continue with further statements in the script.
What should I do to make it work?
Many Thanks