Script for Deleting Core files on root filesystem

ok i am setting up a script to run daily using crontab. This script will search the root filesystem and delete any and all core files. I have set up this script

The only problem i get with this script is it searches for directories and attempts to delete them. Since i have probably 100-200 directories(not by my creation) with the name core(driver files mainly) i do not want to be spammed with a hugh list of directories that cannot be deleted. Is there a way i can fix up this script so it only looks for files and ignores all directories?

BTW this job has to be finished by 1800 hours today. Thank you for all the help you can provide

try to add the option -prune

find / -name core -prune -exec rm -f {} \;

ok i tried the code as you have it, however it still comes up saying rm : cannot remove '<directory path>' : is a directory

to look only for files use: -type f

find / -name core -type f -prune -exec rm -f {} \;

ok thanks ynixon with the -type f on it the script works perfectly. Next questions is: is there a way to send an output to file of the files that were deleted?

you can use the following command before actually deleting

find / -name core -type f -prune -print

will that send it to a file or to the printer?

(i know lpr and lp are the print commands; however, i have never used -print before.)

It "prints" the result to the "standard output".

I.E. It will roll past on the monitor.

You merely need to re-direct that output:

find / -name core -type f -prune -print > /core_file_list
or some other destination.