Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need to create a shell script tha 3

Status
Not open for further replies.

blaqiyce

ISP
May 31, 2001
6
US
I need to create a shell script that will delete core dumps from cold fusion and ags (found in /var) and then add it to the crontab to run hourly. Can anyone help or know what i am talking about (I sure dont).

Thanks
 
To delete core dumps from /var every hour (at 10 past), add the following to your crontab

10 * * * * find /var/core -exec rm {} \; &

Steve



 
what harris79 says is good, but I would use the format :
find /var -name core -exec rm {} \;

if you want to find all the core dumps under /var and its subdirectories.
 
Automating the removal of core dumps is a good idea, but can be frustrating when you have deleted core dumps which you might need to retain for analysis purposes.
Better to retain them for a few days with :-
find /var -name core -ctime +5 -exec rm{}\;
Where the +number is the number of days. This command will therefore only delete core dumps older than 5 days.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top