Managing Server Log Files
Your Virtual Private Server uses log files to record E-mail, FTP, and Web activity on your server. These log
files can be used for debugging problems, tracking abuse, and analyzing traffic to your site.
Web Log Files
Web activity is tracked in your Web Server Log Files.
E-mail and FTP Log File
E-mail and FTP activity is recorded in the ~/var/log/messages file. This records POP and IMAP connections
(checking E-mail), all SMTP activity (sending and recieving E-mail), and FTP connections and transfers.
Managing Log file Size
Because any E-mail, FTP, or Web activity will add to your log files, they can grow quite quickly. Because
of how quickly they can grow, it is important to clear them on an occasional basis. How often you need to do this
depends greatly on how you use your logs, and how much traffic your Virtual Private Server has.
There are a number of Web logfile analyzers which can also be used
to clear out your Web log files. These will not affect your messages file in any way. If you are using
a Web Log analyzer or any other program to clear your Web log files, you will need to clear out your messages file
separately. The easiest way to do this is to create an entry similar to the following in your
Cron File.
0 1 * * 0 /bin/cat /dev/null > $HOME/var/log/messages
The vnukelog utility
In order to make managing your server log files easier, we have created a utility to clear out your server log files.
The vnukelog command can be used to clear the ~/usr/log/messages file as well as all
Web Server Log Files and
Virtual Subhost log files.
Use the -h flag to see all vnukelog options:
% vnukelog -h
Usage: vnukelog [-h] [-i] [-r]
-h display this message
-i enter interactive mode
-r nuke root server logs only
Use no options to nuke all log files on the Virtual Private Servers.
Use the vnukelog command without any flags to clear the ~/usr/log/messages file
and ALL Virtual Private Servers and Virtual Subhost log files:
% vnukelog
Use the -r flag to clear just the Virtual Private Servers log files, and leave the
Virtual Subhost log files intact:
% vnukelog -r
Use the -i flag to enter an interactive mode that allows you to clear just the
Virtual Private Server and Virtual Subhost log files you want to clear.
% vnukelog -i
You can easily use the Cron program scheduler
feature to schedule vnukelog to regularly nuke your Virtual Private Servers log files.
Add something like this to your crontab:
0 1 1 1-12/3 * /usr/local/bin/vnukelog
This will run the command /usr/local/bin/vnukelog (which clears all of your Virtual
Private Server log files) at 1 AM on the first day of the first month of every quarter, or
January, April, July, and October (1-12/3).
|