I want to write shell script to delete files based on file creation datetime. If a file or folder is 30 minutes old then it should delete.
It shouldn't delete viewedit folder.
Example
I have a folder /temp/temp_files under this we have viewedit folder [/temp/temp_files/viewedit] and also so many different folders and file will be there. [Folder and files will be generated by application]
Now except viewedit folder I need to delete all file and folder form /temp/temp_files this location if it is 30 minutes old.
By using find command I am facing lot of problem
i have used like this
find /temp/temp_files/* ! \( -name viewedit -prune \) -a \( -mmin +30 \) -exec rm -rf {} \;
Please can any one help me in this..it will be great helpful for me.
I will wait for the response
Thanks and regards,
vadiraj
Get your own web address for just $1.99/1st yr. We'll help. Yahoo! Small Business.