Sponsored Content
Operating Systems Solaris Something is removing/deleting my wtmpx file? Post 302777705 by MadeInGermany on Friday 8th of March 2013 10:23:13 AM
Old 03-08-2013
Enabling accounting clears wtmpx.
cat /usr/lib/acct/nulladm
Code:
...
for _file
do
        cp /dev/null $_file
        chmod 664 $_file
        chgrp adm $_file
        chown adm $_file
done

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

how to delete entry in file "wtmpx"(/var/adm/wtmpx)

Do someone know how to delete entry(some lines) in file "wtmpx" that command "last" use it. this file is binary so I cannot edit directy. ========================= #last root pts/1 noc Fri Mar 3 22:04 still logged in root pts/1 noc Fri Mar 3 22:01 - 22:02 ... (4 Replies)
Discussion started by: arm_naja
4 Replies

2. UNIX for Dummies Questions & Answers

wtmpx file

Hello everybody: the wtmpx file on my Sol8 machine, got so big (2GB), that my root partition is almost full now, can I empty that file, I read about it that it contains database of user access and auditing, so in case I emptied it will it affect my system?? Thanks alot (3 Replies)
Discussion started by: aladdin
3 Replies

3. Solaris

wtmpx file is too big

Hi, I am using Sun Solaris 5.9 OS. I have found a file called wtmpx having a size of 5.0 GB. I want to clear this file using :>/var/adm/wtmpx. My query is, would it cause any problem to the running live system. Could anyone suggest the best method to clear the file without causing problem to... (6 Replies)
Discussion started by: Vijayakumarpc
6 Replies

4. UNIX for Advanced & Expert Users

wtmpx file is not updating

Hi in my solaris 9 system wmptx file is not updating so it is not recording any login or logout or any other entry. can any one tell me how to solve this problem (0 Replies)
Discussion started by: aaysa123
0 Replies

5. Solaris

wtmpx file

What could possibly happen if wtmpx file got deleted by mistake? Thanks, (8 Replies)
Discussion started by: Pouchie1
8 Replies

6. UNIX for Dummies Questions & Answers

Deleting/Removing sentence from .txt

Hi, now i need to remove the entires i inserted into my .txt file. echo -n "Title: " read Title echo -n "Author: " read Author if grep -q "$Title: $Author" "BookDB.txt"; then sed '$Title: $Author' BookDB.txt echo "Book Title '$Title' removed successfully!" ... (6 Replies)
Discussion started by: santonio
6 Replies

7. Shell Programming and Scripting

Deleting pattern without removing line

I am trying to delete a pattern without removing line. I searched a lot in this forum and using those I could come up with sed command but it seems that command does not work. Here's how my file looks like: 1 ./63990 7 1171 ./63990 2 2425 ./63990 9 2539 ./63990 1 3125 ./63990 1 10141... (7 Replies)
Discussion started by: shoaibjameel123
7 Replies

8. Solaris

WTMPX File corrupted

Hi All I work on solaris 8, 9 and 10 platforms and have encountered an error which is my wtmpx files appear to be corrupted as all entries contain the date 1970 (the birth of unix). Now this is obviously not the case, so my query is: 1 - Can the existing wtmpx files be manipulated to... (6 Replies)
Discussion started by: drestarr96
6 Replies

9. Solaris

Wtmpx File Permissions Question

Hi all, I have been tasked to change permissions on the wtmpx file to 640. Currently the permissions are at 644. My question is will anything be affected if I change the permissions as shown? Thanks in advance. Derek (2 Replies)
Discussion started by: Derk Berk
2 Replies

10. UNIX for Advanced & Expert Users

Getting information from the wtmpx file

Hi, I tried running the command "last" in the server to check the users that were last logged into the system. However, I get this error : root@csidblog:# last /var/adm/wtmpx: Value too large for defined data type How do I proceed to get this info? I read some forums suggesting to use... (2 Replies)
Discussion started by: anaigini45
2 Replies
acctsh(1M)						  System Administration Commands						acctsh(1M)

NAME
acctsh, chargefee, ckpacct, dodisk, lastlogin, monacct, nulladm, prctmp, prdaily, prtacct, shutacct, startup, turnacct - shell procedures for accounting SYNOPSIS
/usr/lib/acct/chargefee login-name number /usr/lib/acct/ckpacct [blocks] /usr/lib/acct/dodisk [-o] [filename...] /usr/lib/acct/lastlogin /usr/lib/acct/monacct number /usr/lib/acct/nulladm filename... /usr/lib/acct/prctmp filename /usr/lib/acct/prdaily [-c] [-l] [mmdd] /usr/lib/acct/prtacct filename [ '' heading ''] /usr/lib/acct/shutacct [ '' reason ''] /usr/lib/acct/startup /usr/lib/acct/turnacct on | off | switch DESCRIPTION
chargefee Command chargefee can be invoked to charge a number of units to login-name. A record is written to /var/adm/fee, to be merged with other accounting records by runacct(1M). ckpacct Command ckpacct should be initiated using cron(1M) to periodically check the size of /var/adm/pacct. If the size exceeds blocks, 500 by default, turnacct will be invoked with argument switch. To avoid a conflict with turnacct switch execution in runacct, do not run ckpacct and runacct simultaneously. If the number of free disk blocks in the /var file system falls below 500, ckpacct will automatically turn off the collection of process accounting records via the off argument to turnacct. When at least 500 blocks are restored, the accounting will be activated again on the next invocation of ckpacct. This feature is sensitive to the frequency at which ckpacct is executed, usually by the cron(1M) command. dodisk Command dodisk should be invoked by cron(1M) to perform the disk accounting functions. lastlogin Command lastlogin is invoked by runacct(1M) to update /var/adm/acct/sum/loginlog, which shows the last date on which each person logged in. monacct Command monacct should be invoked once each month or each accounting period. number indicates which month or period it is. If number is not given, it defaults to the current month (01-12). This default is useful if monacct is to executed using cron(1M) on the first day of each month. monacct creates summary files in /var/adm/acct/fiscal and restarts the summary files in /var/adm/acct/sum. nulladm Command nulladm creates filename with mode 664 and ensures that owner and group are adm. It is called by various accounting shell procedures. prctmp Command prctmp can be used to print the session record file (normally /var/adm/acct/nite/ctmp created by acctcon1 (see acctcon(1M)). prdaily Command prdaily is invoked by runacct(1M) to format a report of the previous day's accounting data. The report resides in /var/adm/acct/sum/rprt/mmdd where mmdd is the month and day of the report. The current daily accounting reports may be printed by typing prdaily. Previous days' accounting reports can be printed by using the mmdd option and specifying the exact report date desired. prtacct Command prtacct can be used to format and print any total accounting (tacct)file. shutacct Command shutacct is invoked during a system shutdown to turn process accounting off and append a reason record to /var/adm/wtmpx. startup Command startup can be invoked when the system is brought to a multi-user state to turn process accounting on. turnacct Command turnacct is an interface to accton (see acct(1M)) to turn process accounting on or off. The switch argument moves the current /var/adm/pacct to the next free name in /var/adm/pacct.incr (where incr is a number starting with 0 and incrementing by one for each addi- tional pacct file), then turns accounting back on again. This procedure is called by ckpacct and thus can be taken care of by the cron(1M) command and used to keep pacct to a reasonable size. shutacct uses turnacct to stop process accounting. startup uses turnacct to start process accounting. OPTIONS
The following options are supported: -c This option prints a report of exceptional resource usage by command, and may be used on current day's accounting data only. -l This option prints a report of exceptional usage by login id for the specified date. Previous daily reports are cleaned up and therefore inaccessible after each invocation of monacct. -o This option uses acctdusg (see acct(1M)) to do a slower version of disk accounting by login directory. filenames specifies the one or more filesystem names where disk accounting will be done. If filenames are used, disk accounting will be done on these filesystems only. If the -o option is used, filenames should be mount points of mounted filesystems. If the -o option is omitted, filenames should be the special file names of mountable filesystems. FILES
/etc/logadm.conf Configuration file for the logadm(1M) command /usr/lib/acct Holds all accounting commands listed in section 1M of this manual /usr/lib/acct/ptecms.awk Contains the limits for exceptional usage by command name /usr/lib/acct/ptelus.awk Contains the limits for exceptional usage by login ID /var/adm/acct/fiscal Fiscal reports directory /var/adm/acct/nite Working directory /var/adm/acct/sum Summary directory that contains information for monacct /var/adm/acct/sum/loginlog File updated by last login /var/adm/fee Accumulator for fees /var/adm/pacct Current file for per-process accounting /var/adm/pacctincr Used if pacct gets large and during execution of daily accounting procedure /var/adm/wtmpx History of user access and administration information ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWaccu | +-----------------------------+-----------------------------+ SEE ALSO
acctcom(1), acct(1M), acctcms(1M), acctcon(1M), acctmerg(1M), acctprc(1M), cron(1M), fwtmp(1M), logadm(1M), runacct(1M), acct(2), acct.h(3HEAD), utmpx(4), attributes(5) NOTES
See runacct(1M) for the main daily accounting shell script, which performs the accumulation of connect, process, fee, and disk accounting on a daily basis. It also creates summaries of command usage. SunOS 5.10 15 Mar 2002 acctsh(1M)
All times are GMT -4. The time now is 02:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy