Sponsored Content
Full Discussion: logs
Top Forums UNIX for Dummies Questions & Answers logs Post 30788 by Cameron on Monday 28th of October 2002 06:10:20 AM
Old 10-28-2002
Just as a suggestion.

You could do the following..

## - Suitable comment here.
[mm] [hh] * * * rm /var/adm/wtmp ; touch /var/adm/wtmp ; chmod ??? /var/adm/wtmp


Makes it easier to read and even more so for newbie's who happen to be learning what is being run from cron.
 

10 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

Logs

hi My name is Juan I dont can clear wtmp and similiar files how i do it? thanks (4 Replies)
Discussion started by: jtapia
4 Replies

2. Shell Programming and Scripting

Logs

Hey Guys, i am new into shell programming and i have to do one script which have to record all the commands entered by a specific user. Example of that, i have a system running on unix, several users are using this system, i have to create like a databse which will record every user entered that... (5 Replies)
Discussion started by: charbel
5 Replies

3. UNIX for Advanced & Expert Users

logs

Hy, I have a question I have a directory in a unix server, Some of my files have a diffrent access time, from the time i accessed them last, I think some one has copied it,it's not an important file,but none the less,it is my file,It mistakenly had a 777 permission( yes ,I know it is a noob's... (1 Reply)
Discussion started by: lordmod
1 Replies

4. Shell Programming and Scripting

filtering the logs

Hi, We are using rsync for syncing remote directories. It is working great along with detailed logs. As the script cron'd and most of the times there're no files to sync we are getting lot of unnecessary log entries and we need to filter them to show only the log entries for the files... (5 Replies)
Discussion started by: prvnrk
5 Replies

5. HP-UX

how to trace the logs

Hi, Last day, In one of our unix boxes there was an issue wherein few of the directory structures were missing / got deleted. Is there any way by which we can find how it happened, I mean by going through syslog / which user had run what command? Thanks for your help (3 Replies)
Discussion started by: vivek_damodaran
3 Replies

6. Shell Programming and Scripting

Grep yesterday logs from weblogic logs

Hi, I am trying to write a script which would go search and get the info from the logs based on yesterday timestamp and write yesterday logs in new file. The log file format is as follows: """"""""""""""""""""""""""... (3 Replies)
Discussion started by: harish.parker
3 Replies

7. UNIX Desktop Questions & Answers

regarding logs

Hi , I am running an application on my windows and it logs are generated at /var/logs and for this i have to go this location and then do tail -f , Is there any command you can advise me so that when I execute this command at this location that logs get displayed fully and as the application... (3 Replies)
Discussion started by: KAREENA18
3 Replies

8. HP-UX

HP-UX LOGS Files

hello, i just want to know logs files for these actions listed below : - User Account Creation - User Account Deletion - Failed and or Successful User Password Changes - Failed Login Activities for all User Users - System Reboot or and shutdown help appreciated... (1 Reply)
Discussion started by: Bolou
1 Replies

9. UNIX for Dummies Questions & Answers

Logs do not rotate

My problem: Both access and error logs do not rotate any more and get really large. They are located here: /srv/www/+vHost name here+/logs/ Configuration seems to be here: /etc/logrotate.conf => looks OK, including "size 10M" to avoid large files (/etc/logrotate.d => is empty) manually... (4 Replies)
Discussion started by: floko
4 Replies

10. Shell Programming and Scripting

If I ran perl script again,old logs should move with today date and new logs should generate.

Appreciate help for the below issue. Im using below code.....I dont want to attach the logs when I ran the perl twice...I just want to take backup with today date and generate new logs...What I need to do for the below scirpt.............. 1)if logs exist it should move the logs with extention... (1 Reply)
Discussion started by: Sanjeev G
1 Replies
WRITETMP(8)						      System Manager's Manual						       WRITETMP(8)

NAME
writetmp - write special wtmp entries to a wtmp file. SYNOPSIS
writetmp [-w wtmp|-] [-X[3|4]] [-u user] [-l line] [-h host] [-i id] [-p pid] [-t type] [-c comment] [--help] [--version] [entry-type] DESCRIPTION
Writetmp is a utility to write special entries to a wtmp file. Useful as either a replacement for the functionality of the "halt -w" or "reboot -w" commands which are normally run at shutdown time or to write special wtmp entries to an alternate wtmp file to which such entries would normally not be written. Under normal conditions radius radtwmp or tacacs accounting logs do not contain shutdown and boottime entries because the access control software is not setup to take into account these events. In the case of a quick shutdown or server crash, the wtmp file(s) will lose coherency. To avoid or minimize the amount of accounting error, it is necessary to write shutdown and boottime entries to such logs. Also changes in time which are made manually with date or via the network with a program such as rdate are not reflected in the accounting logs, which, if the time difference is severe can improperly account time for logins active during the time change. If an entry-type is specified on the command line, the -u, -l, -h, -i, -p, -t and -c options are ignored as writetmp will fill in the user- name, line, id, and host entries as required for that particular wtmp entry-type. Writetmp understands the following entry types: shutdown used just prior to a normal system shutdown. Also accepts halt or reboot as aliases for shutdown. boottime used at system initialization time, to indicate the system is booting. oldtime Indicates the time is about to change. newtime Indicates the time has changed. The difference in time is determined from the timestamp on the last oldtime entry. runlevel Indicates a change in runlevel (useless in an accounting sense). OPTIONS
Writetmp understands the following command line switches: --help Outputs a verbose usage listing. --version Displays the version of writetmp. -w wtmp Select a different output file instead of the default (/var/log/wtmp). -X[3] Write to a wtmp file maintained by versions 3.3 or 3.4 Tacacs terminal server access control software. -X4 Write to a wtmp file maintained by version 4.0 of Tacacs terminal server access control software. -u user Specify the username for the username field. -l line Specify the tty name for the line field. -h host Specify the hostname. -i id Specify the init id name. Not applicable to tacacs wtmp files. -p pid Specify the pid number. Not appliccable to tacacs wtmp files. -t type Specify the type of wtmp entry for the ut_type field, not to be confused with entry-type. May be coded as a number or one of: unknown, runlevel, boottime, newtime, oldtime, init, login, user or dead. -c comment Specify the comment for the tacacs 4 wtmp comment field (16 characters max). EXAMPLES
Write a shutdown message to an alternate wtmp log: writetmp -w /var/adm/xtmp shutdown A shell script to update the time in an alternate wtmp file when netdate is run: #!/bin/sh writetmp -w /var/adm/xtmp oldtime netdate clock.llnl.gov writetmp -w /var/adm/xtmp newtime Find out how often and for how long people run a specific program, such as pine: #!/bin/sh # /var/adm/cmdtmp must be globally writable. cmdtmp=/var/adm/cmdtmp writetmp -w $cmdtmp -u pine -l cmd$$ -h $USER -t user /path/to/real-pine $* writetmp -w $cmdtmp -l cmd$$ -t dead FILES
/var/log/wtmp login database. AUTHOR
Steve Baker (ice@mama.indstate.edu) BUGS
Does not lock the wtmp file and does not guarantee a successful write. Could in theory corrupt a log file. Rdate and netdate can take seconds to complete, so writing oldtime/newtime records around them may not be entirely accurate. SEE ALSO
date(1), last(1), sac(8), netdate(8L), reboot(8) UNIX Manual WRITETMP(8)
All times are GMT -4. The time now is 06:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy