AIXThis forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a box that had accounting enabled, but was forgotten about by a previous admin and as a result has a rather large wtmp file. Does anyone know of a perl script (or other) that will allow me to clean this file up?
I have found one, but it doesn't seem to be using the same format wtmp file. It doesn't account for all the fields in the wtmp file on the aix boxes.
I do not want to annihilate the whole file using cp /dev/null.
Just for fun, I would
1) backup wtmp, just in case : mv wtmp wtmp.first
2) tail -100 wtmp.first >wtmp.
3) if this did the job
then
thanks Zorba
else
sorry
Although it doesn't affect wtmp, AIX has log rotation built in for syslog - you just specify in /etc/syslog.conf
Code:
[rotate [size <size> k|m] [files <files>] [time <time> h|d|w|m|y] [compress] [
archive <archive>]] is:
# If <destination> is a regular file and the word "rotate" is
# is specified, then the <destination> is limited by either
# <size> or <time>, or both <size> and <time>. The <size> causes
# the <destination> to be limited to <size>, with <files> files
# kept in the rotation. The backup filenames are created by
# appending a period and a number to <destination>, starting with
# ".0". The <time> causes the <destination> to be rotated after
# <time>. If <time> is specified, the backup filenames are created
# by appending the date and time to <destination>, in the format
# YYYYmmmdd:HH:MM:SS where:
# YYYY = year
# mmm = name of the month
# dd = day
# HH = hour
# MM = minutes
# SS = seconds
# If both <size> and <time> is specified, and the <size> causes
# the log to rotate, then the backup filenames will be created
# by appending both the date and time and a period and a number to
# <destination>.
# The minimum size that can be specified is 10k, the minimum
# number of files that can be specified is 2. The default
# size is 1m (meg) and the default for <files> is unlimited.
# Therefore, if only "rotate" is specified, the log will be
# rotated with <size> = 1m.
# The compress option means that rotated log files that are not
# in use will be compressed.
# The archive option will save rotated log files that are not
# in use to <archive>.
# The default is not to rotate log files.
# Example :
# *.debug /tmp/syslog.out rotate size 100k files 4
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.