GoWilkes

Well-Known Member
Sep 26, 2006
495
12
168
cPanel Access Level
Root Administrator
It's been awhile since I had to do this, so I hope you guys don't mind holding my hand :)

I have a weird log file in the /tmp directory, named Net.WhoisIP.log. I gather that it's related to the Net::Whois Perl module that I use, but I can't find a way to turn off the log! When I looked earlier today, the log file was around 2G.

I don't know if deleting it will impact the module, so I figured I would just empty it through a cron every month.

IIRC, this needs to be done by manually editing /etc/crontab.

Assuming that's correct, does this look right?

Code:
59 1 31 * * root > /tmp/Net.WhoisIP.log
I'm trying to make it run at 1:59am on the 31st of the month, which presumably means it would run every other month.

Note that there's a single whitespace separating everything, including the "> /tmp/..." command. Is that correct? I ask because it looks weird, like the last space would be a confusing delimiter, which makes me worry that I'll accidentally truncate every file in /root/! LOL

TIA!
 

24x7server

Well-Known Member
Apr 17, 2013
1,911
96
78
India
cPanel Access Level
Root Administrator
Twitter
Hello :)

Yes, You have setup correct cron.

Code:
59 1 31 * * root > /tmp/Net.WhoisIP.log
If you this cron on your server then it will be run at :

2016-01-31 01:59:00
2016-03-31 01:59:00
2016-05-31 01:59:00
2016-07-31 01:59:00
2016-08-31 01:59:00
....
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,203
363
Hello :)

You may want to configure a script that completes the removal so that you configure the cron job like this:

Code:
59 1 31 * * /path/to/removal-script.sh
Thank you.