- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- btmps and wtmps files
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2007 10:11 PM
04-11-2007 10:11 PM
wtmps and btmps are too much large. Can we initialize these files?
Thanks in advance for your help.
Regards,
Carles
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2007 10:27 PM
04-11-2007 10:27 PM
Re: btmps and wtmps files
- and -
> /var/adm/btmp
will do the job.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2007 10:38 PM
04-11-2007 10:38 PM
Re: btmps and wtmps files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2007 11:06 PM
04-11-2007 11:06 PM
Solutioni've recently wrote a script for purging these files, it's here:
---<---
#!/bin/ksh
[ "$(uname -s)" = "HP-UX" ] && {
MAX_SIZE="1024000"
REST_LINES="10000"
for XTMP in /var/adm/wtmp /var/adm/btmp /etc/utmp
do
[ -f "$XTMP" ] || continue
SIZE=
SIZE=$(/bin/ls -l $XTMP |awk '{print $5}' 2>/dev/null)
if [ "$SIZE" -gt "$MAX_SIZE" ]
then
/usr/sbin/acct/fwtmp < ${XTMP} >/tmp/${XTMP##*/}.OLD
tail -n $REST_LINES /tmp/${XTMP##*/}.OLD |/usr/sbin/acct/fwtmp -ic > $XTMP
rm /tmp/${XTMP##*/}.OLD 2>/dev/null
fi
done
}
---<---
regards,
Cedrick Gaillard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2007 01:04 AM
04-12-2007 01:04 AM
Re: btmps and wtmps files
Regards,
Carles