|
Finding Hidden files and protecting the folder containing hidden files from deletion
Hi. I have a script which is deleting files with a particular extension and older than 45 days.The code is:
find <path> -name "<filename_pattern>" -mtime +45 -exec rm {} \;
But the problem is that some important files are also getting deleted.To prevent this I have decide to make a dummy hidden file in such folders which are not to be considered when this script is run.
Is this the right way to achieve the desired result???
If yes, then how can I do this??
If not, then what should be the ideal way??
Please.I need the solution urgently..
Thanx.
Last edited by pochaw; 10-03-2006 at 05:38 AM..
|