RTCruiser
Jul 12 2007, 09:35 AM
One of my clients is using a program that regularly creates HUGE core files that I have to manually delete before his domain exceeds it's quota.
I'd like to create a cron job that goes in each night and deletes them but my cronjob skills are such that I'm a little nervous about creating one that deletes files. So I'd like a little help here.
Does this look like the correct format:
30 12 * * * rm /home/[domian]/public_html/cgi-bin/dada/core.*
Thanks for any advice.
BlueFusion
Jul 12 2007, 09:38 AM
I'd use rm -f to ensure that it forces a delete without it prompting a user (that isn't there).
And if your server is CST, it will run at 12:30PM (afternoon) not night. If you want it to run at 12:30AM (night), then that would be 30 0 * * *
RTCruiser
Jul 12 2007, 02:19 PM
QUOTE (BlueFusion @ Jul 12 2007, 11:38 AM)

I'd use rm -f to ensure that it forces a delete without it prompting a user (that isn't there).
And if your server is CST, it will run at 12:30PM (afternoon) not night. If you want it to run at 12:30AM (night), then that would be 30 0 * * *
Very cool. Thanks for your input!
James Jhurani
Jul 13 2007, 06:01 AM
I would suggest full path to rm, since cron does not have any ENV settings.
BlueFusion
Jul 13 2007, 08:38 AM
I do believe that RH/CentOS and other distros have $PATH defined. I've only ever had to use a full path in crontab on Solaris.
James Jhurani
Jul 13 2007, 10:28 AM
Good to know, i've always used full path out of habit.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.