| Appendix |
351
To test this, run the following commands:
# logger -p local2.info aspera test
# cat /var/log/aspera.log
The
cat
command should display something similar to the following:
Jun 13 10:30:33 linux-kua5 root: aspera test
Rotating Your Aspera Log File
There are several ways to rotate Aspera logs in Linux:
1.
Add
/var/log/aspera.log
to
/etc/logrotate.d/syslog
.
2.
Create an entry for
aspera.log
in
/etc/logrotate.conf
.
3.
Create a separate configuration file for
aspera.log
in
/etc/logrotate.d/
.
The first option rotates your logs with the system logs (usually once a week, compressed, and saving the last 10 logs).
On some servers, there is so much traffic that the logs need to be rotated more often than once a week, in which case
option 2 or 3 should be used.
1. Add
/var/log/aspera.log
to the entries in
/etc/logrotate.d/syslog
, as follows:
/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/
log/boot.log /var/log/cron /var/log/aspera.log
{
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null ||
true
/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null ||
true
endscript
}
2. Edit
/etc/logrotate.conf
by adding the configuration after the line "
# system-specific logs
may also be configured here.
" The following example compresses and rotates 10 logs whenever
/
var/log/aspera.log
reaches 100MB. After log rotation is complete, it runs whatever scripts are specified by
postrotate ... endscript
.
/var/log/aspera.log {
rotate 10
size 100M
create 664 root
postrotate
/usr/bin/killall -HUP syslogd
endscript
compress
}
The following example compresses and rotates 10 logs once daily. Instead of moving the original log file and creating
a new one, the
copytruncate
option tells
logrotate
to first copy the original log file, then truncate it to zero
bytes.
/var/log/aspera.log {
daily
rotate 10
copytruncate
compress
}