Visit The New, Modern Unix Linux Community


Wtmp empty everyday


 
Thread Tools Search this Thread
Operating Systems AIX Wtmp empty everyday
# 1  
[Solved] 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.
# 2  
Hi,

i don't know about a automatism, which clean the wtmp by default but there are some script (search in the forum or use google) which can do that.
Most of these scripts use the /usr/sbin/acct/fwtmp comman. man fwtmp

I would have a look at the crontab for such script...

Regards
# 3  
Hi.
You can check in /etc/logrotate.conf
There is the way to rotate wtmp log file.
# 4  
Another possible cause could be skulker. It could be configured to shorten the wtmp file, see the man page of skulker.

I hope this helps.

bakunin
# 5  
Thanks. Found a 'cp -p dev/null /var/adm/wtmp' from crontab.

Moderator's Comments:
Mod Comment edit by bakunin: thanks for the follow-up. I changed the threads title to "solved".

Last edited by bakunin; 05-28-2013 at 07:15 PM..
# 6  
This solves the riddle. I'd like to comment, though, that this is a dangerous practice, because it changes the files inode-number. I suggest to change this to

Code:
cat /dev/null > /var/adm/wtmp

which will shorten the file too but leaves its metadata intact.

I hope this helps.

bakunin
# 7  
Quote:
Originally Posted by bakunin
Code:
cat /dev/null > /var/adm/wtmp

cat serves no purpose in that construct. The file is truncated by the shell when it handles the redirection operation, before invoking cat. The following should do it:
Code:
> /var/adm/wtmp

Regards,
Alister

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #777
Difficulty: Easy
The Fourier transform can be formally defined as an improper Riemann integral.
True or False?

8 More Discussions You Might Find Interesting

1. AIX

AIX cron job is running everyday instead of on a particular day

Hello, I was trying to run a script on a dev server using cron job. It supposed to run 3rd sunday of every month. 45 4 15-21 * 0 /home/user1/myscript.sh >/dev/null 2>&1 # run this script 3rd sunday of every month When I Schedule it on AIX server, It is running every day at 4:45 AM. am I... (3 Replies)
Discussion started by: Kumar7997
3 Replies

2. UNIX for Dummies Questions & Answers

UNIX Account getting Locked Everyday between same Time Frame

I am facing an Issue with a particular Unix Account ( ie a particular Userid) getting LOCKED everyday between 7:30am and 8:00am. The Password associated with this particular Account has been setup such that it should never Expire at all but it does LOCK the Account after more than 3 failed... (5 Replies)
Discussion started by: pchegoor
5 Replies

3. Shell Programming and Scripting

Adding a cron job that will execute everyday at 14:50 hrs

Hi I want to execute a cron job everyday at 14:50 hrs. I have a script like this: TMP_FILE="/tmp/tmpcron.txt" RES=0 /usr/bin/crontab -l >> $TMP_FILE ADD_JOB="50 14 * * * /opt/mypath/scriptname.sh" grep "scriptname.sh" $TMP_FILE >> /dev/null JOB_NOT_EXIST=$? if test $JOB_NOT_EXIST... (2 Replies)
Discussion started by: saurabhkoar
2 Replies

4. Shell Programming and Scripting

Rotate log everyday on existing script

quick question: I have a current script that will put the output on a log file. See snapshot of the code below. I wanted this to be rotated everyday based on date. So if anyone execute the script today there will be a filecreated such as sys.log.(datetoday), if tomorrow it would be... (1 Reply)
Discussion started by: lhareigh890
1 Replies

5. Shell Programming and Scripting

How to run a script everyday between 7 and 8 pm with the time interval of 5 minutes?

Hi, Can someone help me in running a cronjob everyday between 7 and 8 pm with the time interval of 5 minutes in between to repeat that script. The script is so small and I need that to run daily between this time. Please if possible provide me the syntax for this logic. Thanks. (4 Replies)
Discussion started by: cya
4 Replies

6. UNIX for Dummies Questions & Answers

How to make cronjob output to different files everyday

Hello, I have a cronjob that i am currently running which is as follows: php /home/****/cronjob.php --debug 2>&1 >> /home/cronjoboutput.txt That, as you may know, logs the output to a file called cronjoboutput.txt in the home directory. I want that cronjob to output to a different file... (6 Replies)
Discussion started by: umarsa
6 Replies

7. Shell Programming and Scripting

Capturing and sending of vmstat output everyday

I need to capture the vmstat output of a server every 5 minutes, in a text filename with the name in the format vmoutput. yesterday's date.txt. I need to get the vmstat o/p for the whole day with 5 minutes interval and send it (preferably ftp) to my local desktop folder. eg: vmstat 300... (1 Reply)
Discussion started by: yuvanash
1 Replies

8. Shell Programming and Scripting

Everyday appending info about all processes which are active..

I have problem but i didnt solve it. Could you help me? :) Problem: Everyday at 12.17 we will append information to the file "log" about users who are logged and the information about all processes which are active to the user_activity file in our home directory.. I know that I must use cron... (1 Reply)
Discussion started by: mavikartal
1 Replies

Featured Tech Videos