Sponsored Content
Top Forums Shell Programming and Scripting Script to truncate wtmp files Post 302903005 by ElizabethPJ on Friday 23rd of May 2014 11:48:39 AM
Old 05-23-2014
Script to truncate wtmp files

Hi,

Does anyone have a script to truncate the wtmp file.

I want to move older entries in the wtmp to a new file and move it out of var/adm and shrink the size.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Need Wtmp Reader

I would loke to read the WTMP file. This is a binary file in the /var/logs directory. Is there any utility which will convert this binary file to ASCII format? (1 Reply)
Discussion started by: pgold1
1 Replies

2. UNIX for Dummies Questions & Answers

Resetting WTMP?

When I type last oracle I get dates from Nov 28, 2000 all the way back to the beginning of time it seems. The 11-28-2000 entry states that Oracle is still logged in, but if you type a who, it shows only 1 entry - the currently logged in user (Me as oracle), but I logged in only minutes ago - and... (4 Replies)
Discussion started by: cuppjr
4 Replies

3. UNIX for Dummies Questions & Answers

wtmp

Hi, is it ok if i delete wtmp on HPUX 11 under /var/adm It is filling up that filesystem Cheers (2 Replies)
Discussion started by: dsharples
2 Replies

4. UNIX for Dummies Questions & Answers

truncate wtmp

I have AIX5.1 I have been trying to learn how to truncate the /var/adm/wtmp file. I have seen several things on google actually but don't quite understand. I also searched your forums but couldn't find it. one says this ">/var/adm/wtmp Is that all I do? I have a seperate question also. I was... (1 Reply)
Discussion started by: rocker40
1 Replies

5. Shell Programming and Scripting

truncate file script is not working

Hi All, I have an application which writes log in to a file. The file size becomes around min of 800 MB a day. So I have written a script which backup the file and truncate the original file. My script is like this cp X.log /backup/X.log1 > X.log But the second truncate command... (3 Replies)
Discussion started by: mvenkat_in
3 Replies

6. Shell Programming and Scripting

Truncate Log files

Hi Gurus, I have several log files running in real time and needs to be truncated 50% or all but has to keep the logs piling up. Any ideas? For example: /var/adm/messages and others apps log files Thanks in advance! (7 Replies)
Discussion started by: anonymous1
7 Replies

7. UNIX for Dummies Questions & Answers

Script required to truncate all the lines except a specific snippet.

Hi, I have a file with the following structure. XXXXX........... YYYYY........... ................. .................. ZZZZZZ...... qwerty_start.............. .................. ................. .................. querty_end................ .............................. (3 Replies)
Discussion started by: abinash
3 Replies

8. Shell Programming and Scripting

Making wtmp files readable one at a time

New Unix user/scripter here. Been trying to solve a problem for two days now with no luck. Hoping someone here has an answer. Essentially I have a list of wtmp files which I have decompressed and copied to a temporary directory. Using the following command I can turn them into a file than can... (4 Replies)
Discussion started by: Stryfe16
4 Replies

9. Red Hat

wtmp output

Hi, Can anybody explain wtmp output fields? A dir was created at 7:11pm and I wanted to find out who was logged in at that time but as you can see there is no ip address listed when I run utmpdump against the wtmp file..... R, D. (1 Reply)
Discussion started by: Duffs22
1 Replies
LAST(1) 						      General Commands Manual							   LAST(1)

NAME
last - indicate last logins of users and teletypes SYNOPSIS
last [ -f filename ] [ -N ] [ name ... ] [ tty ... ] DESCRIPTION
Last will look back in the wtmp file which records all logins and logouts for information about a user, a teletype or any group of users and teletypes. Arguments specify names of users or teletypes of interest. Names of teletypes may be given fully or abbreviated. For example `last 0' is the same as `last tty0'. If multiple arguments are given, the information which applies to any of the arguments is printed. For example `last root console' would list all of "root's" sessions as well as all sessions on the console terminal. Last will print the sessions of the specified users and teletypes, most recent first, indicating the times at which the session began, the duration of the session, and the teletype which the session took place on. If the session is still continuing or was cut short by a reboot, last so indicates. The pseudo-user reboot logs in at reboots of the system, thus last reboot will give an indication of mean time between reboot. Last with no arguments prints a record of all logins and logouts, in reverse order. The -f filename option allows the user to examine an alternate wtmp file. The -N option limits the report to N lines. If last is interrupted, it indicates how far the search has progressed in wtmp. If interrupted with a quit signal (generated by a con- trol-) last indicates how far the search has progressed so far, and the search continues. FILES
/usr/adm/wtmp login data base /usr/adm/shutdownlog which records shutdowns and reasons for same SEE ALSO
wtmp(5), ac(8), lastcomm(1) AUTHOR
Howard Katseff 4th Berkeley Distribution April 29, 1985 LAST(1)
All times are GMT -4. The time now is 12:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy