Sponsored Content
Full Discussion: Resetting WTMP?
Top Forums UNIX for Dummies Questions & Answers Resetting WTMP? Post 1292 by 98_1LE on Thursday 22nd of February 2001 09:07:34 AM
Old 02-22-2001
To reste the data (on Solaris);
cat /dev/null > /var/adm/wtmp
cat /dev/null > /var/adm/wtmpx
cat /dev/null > /var/adm/utmp
cat /dev/null > /var/adm/utmpx

Note that last, who, w etc. will not return the correct data until a reboot so if possible it is adviseable to do this right before a reboot.
 

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

manage the wtmp file

Here's a usefull perl script to trim the wtmp file, in case it got too big, which happens sometimes, or got curropted (which also happens often). You could learn from here how to parse the wtmp file... but of course for just reading its content always simply use "last" like Neo said.... ... (0 Replies)
Discussion started by: me2unix
0 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. AIX

wtmp file

Hello everyone I have a problem with the file wtmp that is on /var/adm This file was not on this directory (adm). I try creating a new file with the correct rights (644) and owner (adm:adm) but It doesnt work. If I type the last command i get this last ora10g ... (4 Replies)
Discussion started by: lo-lp-kl
4 Replies

6. Shell Programming and Scripting

Resetting date

Hi there, Is there a way i can reset the date on my unix terminal to yesterday's date? date Tue Jul 1 14:18:21 GMT 2008 Please let me know. JAK (7 Replies)
Discussion started by: jakSun8
7 Replies

7. AIX

Clear wtmp

Hello, Is there a difference between the following commands besides consider the file permissions? /usr/sbin/acct/nulladm /var/adm/wtmp >/var/adm/wtmp cat /dev/null >/var/adm/wtmp Today I tried the second command and it worked... (2 Replies)
Discussion started by: x_adm
2 Replies

8. 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

9. AIX

Wtmp empty everyday

Anyone got experience where wtmp logs get truncated everyday? Though sulog, failedlogin and lastlog seems to be fine. The server uptime is 18 days running on AIX 5.3. Sorry this seems to be a generic questions but never really encountered before. (6 Replies)
Discussion started by: depam
6 Replies
SHUTDOWN(8)						    BSD System Manager's Manual 					       SHUTDOWN(8)

NAME
shutdown, poweroff -- close down the system at a given time SYNOPSIS
shutdown [-] [-h | -p | -r | -k] [-o [-n]] time [warning-message ...] poweroff DESCRIPTION
The shutdown utility provides an automated shutdown procedure for super-users to nicely notify users when the system is shutting down, saving them from system administrators, hackers, and gurus, who would otherwise not bother with such niceties. The following options are available: -h The system is halted at the specified time. -p The system is halted and the power is turned off (hardware support required) at the specified time. -r The system is rebooted at the specified time. -k Kick everybody off. The -k option does not actually halt the system, but leaves the system multi-user with logins disabled (for all but super-user). -o If one of the -h, -p or -r options are specified, shutdown will execute halt(8) or reboot(8) instead of sending a signal to init(8). -n If the -o option is specified, prevent the file system cache from being flushed by passing -n to halt(8) or reboot(8). This option should probably not be used. time Time is the time at which shutdown will bring the system down and may be the case-insensitive word now (indicating an immediate shut- down) or a future time in one of two formats: +number, or yymmddhhmm, where the year, month, and day may be defaulted to the current system values. The first form brings the system down in number minutes and the second at the absolute time specified. +number may be specified in units other than minutes by appending the corresponding suffix: ``s'', ``sec'', ``m'', ``min''. ``h'', ``hour''. warning-message Any other arguments comprise the warning message that is broadcast to users currently logged into the system. - If '-' is supplied as an option, the warning message is read from the standard input. At intervals, becoming more frequent as apocalypse approaches and starting at ten hours before shutdown, warning messages are displayed on the terminals of all users logged in. Five minutes before shutdown, or immediately if shutdown is in less than 5 minutes, logins are dis- abled by creating /var/run/nologin and copying the warning message there. If this file exists when a user attempts to log in, login(1) prints its contents and exits. The file is removed just before shutdown exits. At shutdown time a message is written to the system log, containing the time of shutdown, the person who initiated the shutdown and the rea- son. The corresponding signal is then sent to init(8) to respectively halt, reboot or bring the system down to single-user state (depending on the above options). The time of the shutdown and the warning message are placed in /var/run/nologin and should be used to inform the users about when the system will be back up and why it is going down (or anything else). A scheduled shutdown can be canceled by killing the shutdown process (a SIGTERM should suffice). The /var/run/nologin file that shutdown created will be removed automatically. When run without options, the shutdown utility will place the system into single user mode at the time specified. Calling ``poweroff'' is equivalent to running: shutdown -p now FILES
/var/run/nologin tells login(1) not to let anyone log in EXAMPLES
Reboot the system in 30 minutes and display a warning message on the terminals of all users currently logged in: # shutdown -r +30 "System will reboot" COMPATIBILITY
The hours and minutes in the second time format may be separated by a colon (``:'') for backward compatibility. SEE ALSO
kill(1), login(1), wall(1), nologin(5), halt(8), init(8), reboot(8) HISTORY
The shutdown utility appeared in 4.0BSD. BSD
December 15, 2014 BSD
All times are GMT -4. The time now is 11:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy