Sponsored Content
Full Discussion: Clear logs in unix sco 5.0.4
Special Forums UNIX Desktop Questions & Answers Clear logs in unix sco 5.0.4 Post 18385 by killerserv on Wednesday 27th of March 2002 07:24:38 PM
Old 03-27-2002
In SCO Open Server
the information in /etc/wtmp is cleared out weekly by a cron job that runs /etc/cleanup, you may want to adjust this script if you need longer records to be maintained there.

Generally, you can just use the ">" to empty a log file. For example, to clear out /var/tmp/log, just use:

# > /var/tmp/log

That will empty the file while leaving ownerships and permissions intact.

Sometimes, however, you have a program that keeps the file open while it writes to the log. In such a case, you may need to stop the program, clear the log, and restart.

You can easily check to see if any process is using a file with "fuser":

# fuser /var/tmp/log

will return the pid of syslog. You can combine all this:

# ps -p `fuser /var/tmp/log

*Finally pls maintain your post in one thread. post back if this doesnt help.
 

10 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

SCO TCP/IP runtime System for SCO Unix

Hi everyone i have a question for all of you. It may be basic or it may be a good one. I recently aquired a copy of "SCO TCP/IP runtime System for SCO Unix" (thats what the disks say) and for the life of me i can not get it to load. i have tried opening the disk in linux and it can not determine... (0 Replies)
Discussion started by: Cerberus
0 Replies

2. HP-UX

Unix - Logs

Hi All, Can anybody tell me, how to trace out user access to the Unix Server Machine, (i,e) I want to find out the user who had executed some commands to alter the cron file. Regards Nag (3 Replies)
Discussion started by: nag_sundaram
3 Replies

3. UNIX for Dummies Questions & Answers

Clear Case views on UNIX

Friends, I was asked to work on Clear Case after setting up. For this created a dynamic view by using the command, 'cleartool mkview -tag <view name> -stgloc viewstg'. Now I am not sure how to proceed further :-( May I request you to help me out in continuing further. I have a deadline in... (1 Reply)
Discussion started by: mmohan
1 Replies

4. UNIX for Dummies Questions & Answers

FTP Logs in Unix

Hi. Is there a way or command (other than netstat) in Unix to find out or get a list a users who FTP into a particular server? Like, say last 1000 users. I need to get the user ID (any info), who FTP to a particular server. netstat gives only the users who have an FTp session currently. ... (2 Replies)
Discussion started by: manisendhil
2 Replies

5. UNIX for Advanced & Expert Users

FTP Logs in Unix

Hi. Is there a way or command (other than netstat) in Unix to find out or get a list a users who FTP into a particular server? Like, say last 1000 users. I need to get the user ID (any info), who FTP to a particular server. netstat gives only the users who have an FTp session currently. ... (4 Replies)
Discussion started by: manisendhil
4 Replies

6. HP-UX

Unix Security - SU logs

Hi, Hope its good with everyone. I have the below su logs and i dont understand the bolded numbers. can someone help me please. Jul 24 11:55:50 su: - 8 username Jul 24 12:12:40 su: - 10 username Jul 26 11:15:32 su: - 7 username I understand these are failed logins but what does that... (1 Reply)
Discussion started by: indraseng
1 Replies

7. SCO

load sco xenix and sco unix binary ?

Hi I have some sco xenix object, bin and archive files that operate in sco unix 5.0.7. I know that sco unix kernel can support sco xenix binary. I want to know how can I link xenix and unix archives together? (0 Replies)
Discussion started by: javad1_maroofi
0 Replies

8. Shell Programming and Scripting

How to clear history logs of all terminal sessions

Hi, I would normally clear off the history entries from a terminal by using the following commands: > ~/.bash_history history -c But this will remove the entries of that particular session only. How to prune all the entries of all login sessions for a particular user in a system? N.B:... (3 Replies)
Discussion started by: royalibrahim
3 Replies

9. UNIX for Dummies Questions & Answers

Unix : About options of clear command ?

Hello everyone, My question is quite simple, even if I didn't find an answer. I would want a command (maybe clear with some options ?) that can do the following : clear completely the console, as it is when we start a console for the first time. My problem is that I sometimes display a lot... (5 Replies)
Discussion started by: Ben31400
5 Replies

10. Shell Programming and Scripting

Command to clear logs for every 6 hours in solaris

Hi Folks, I need to remove log files for six hours on Solaris. before i used to do for every 24 hours below is the code for 1 day older log files, now i tried using -mmin +360 but it says command not found. Can someone please help me out!!! part of the code: LOG_FILE=`find /home/Logdir... (1 Reply)
Discussion started by: Sendhil.Kumaran
1 Replies
strclean(8)						      System Manager's Manual						       strclean(8)

NAME
strclean - Removes outdated STREAMS error log files SYNOPSIS
/usr/sbin/strclean [-d logdir] [-a age] FLAGS
Specifies a maximum age in days for the STREAMS error log files if this not the default age of 3. The value of age must be an integer greater than or less than 3. Specifies a directory for the location of the STREAMS error log files to be removed if this is not the default directory /var/adm/streams. DESCRIPTION
The strclean command cleans the STREAMS error logger directory of log files (error.mm-dd) that contain error messages sent by the STREAMS log driver (strlog). If no other directory is specified (the logdir argument), the command removes error log files in the /var/adm/streams directory. If no other age is specified (the age argument), the command removes error log files that have not been modified in 3 days. The strclean command is executed by the cron daemon on a periodic basis. EXAMPLES
To remove the day-old error log files from a directory called /tmp/streams, enter: strclean -d /tmp/streams -a 1 FILES
One or more error log file or files on which strclean operates. The mm.dd in the filename indicates the month and day of the messages con- tained in the file. RELATED INFORMATION
Commands: strerr(8), cron(8). Interfaces: strlog(7). delim off strclean(8)
All times are GMT -4. The time now is 12:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy