Sponsored Content
Full Discussion: Not able to delete log file
Operating Systems Solaris Not able to delete log file Post 302865155 by solaris_1977 on Thursday 17th of October 2013 07:58:37 PM
Old 10-17-2013
Not able to delete log file

On my solaris-10 box, there are two log files which are being used (written by) some application. Those are hige files of 3 gb and 5 gb. I tried to nullify it, but it shows me zero size and after few seconds it will show me its original size. "ls -ltr" shows me big size, but "du -sh file" shows me in kb. We do not want to stop application to clear these files. Is there any way to clear them without stopping application. Below outputs should say my problem more clearly.
Code:
root@prd_db07:/oimDomain/logs# ls -l soa.out admin.out
-rw-r--r--   1 iamswl1  dggess     330644050 Oct 17 16:53 admin.out
-rw-r--r--   1 iamswl1  dggess     5163031517 Oct 17 16:53 soa.out
root@prd_db07:/oimDomain/logs# du -sh soa.out admin.out
 134K   soa.out
 260K   admin.out
root@prd_db07:/oimDomain/logs# fuser soa.out
soa.out:    21268o   21243o   21242o
root@prd_db07:/oimDomain/logs# fuser admin.out
admin.out:    19903o   19878o
root@prd_db07:/oimDomain/logs#
root@prd_db07:/oimDomain/logs# ptree 21268
3118  zsched
  21242 /bin/sh /dggess/envs/stage/domains/oimDomain/bin/startManagedWebLogic.sh soa_serv
    21243 /bin/sh /dggess/envs/stage/domains/oimDomain/bin/startWebLogic.sh nodebug noderby
      21268 /dggess/apps/jdk/jdk1.6.0_29/bin/sparcv9/java -server -Xmx4096m -Xms4096m -XX:Per
root@prd_db07:/dggess/apps/logs/oimDomain#
root@prd_db07:/dggess/apps/logs/oimDomain# ptree 19903
3118  zsched
  19878 /bin/sh /dggess/envs/stage/domains/oimDomain/bin/startWebLogic.sh
    19903 /dggess/apps/jdk/jdk1.6.0_29/bin/sparcv9/java -server -Xms2048m -Xmx2048m -XX:Max
root@prd_db07:/oimDomain/logs# >soa.out
root@prd_db07:/oimDomain/logs# >admin.out
root@prd_db07:/oimDomain/logs# ls -l soa.out admin.out
-rw-r--r--   1 iamswl1  dggess           0 Oct 17 16:54 admin.out
-rw-r--r--   1 iamswl1  dggess           0 Oct 17 16:54 soa.out
root@prd_db07:/oimDomain/logs#
root@prd_db07:/oimDomain/logs# ls -l soa.out admin.out   ---> AFTER A WAIT OF 3-4 SECONDS, IT IS AGAIN BACK TO SAME SIZE
-rw-r--r--   1 iamswl1  dggess     330651280 Oct 17 16:54 admin.out
-rw-r--r--   1 iamswl1  dggess     5163034962 Oct 17 16:54 soa.out
root@prd_db07:/oimDomain/logs#

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

mass delete a certain string in a .log file

Hey all. I have a file that has roughly 115,000 lines in it. There are a few lines of information that I don't want in it, but I don't want to search through all of the lines to find the ones that I don't want. Is there a way to do a mass delete of the lines that I don't want? Thanks for the... (4 Replies)
Discussion started by: jalge2
4 Replies

2. Shell Programming and Scripting

how to delete blank rows in a log file

Help How to delete all blank rows in log file (4 Replies)
Discussion started by: suryanarayana
4 Replies

3. Shell Programming and Scripting

Delete lines prior to a specific date in a log file.

Hi all. I have a database log file in which log data get appended to it daily. I want to do a automatic maintainence of this log by going through the log and deleting lines belonging to a certain date. How should i do it? Please help. Thanks. Example. To delete all lines prior to Jun... (4 Replies)
Discussion started by: ahSher
4 Replies

4. Shell Programming and Scripting

Delete log file entries based on the Date/Timestamp within log file

If a log file is in the following format 28-Jul-10 ::: Log message 28-Jul-10 ::: Log message 29-Jul-10 ::: Log message 30-Jul-10 ::: Log message 31-Jul-10 ::: Log message 31-Jul-10 ::: Log message 1-Aug-10 ::: Log message 1-Aug-10 ::: Log message 2-Aug-10 ::: Log message 2-Aug-10 :::... (3 Replies)
Discussion started by: vikram3.r
3 Replies

5. Shell Programming and Scripting

Log file - Delete lines

Hello, I tried to search on the site a way to delete lines on log files but I didn't find what I am looking for... I hope someone will be able to help me. I do not know how to explain this, so I will do my best. I have a log file and I want to delete all second lines. Example : ... (3 Replies)
Discussion started by: Aswex
3 Replies

6. Shell Programming and Scripting

Delete log files content older than 30 days and append the lastest date log file date

To delete log files content older than 30 days and append the lastest date log file date in the respective logs I want to write a shell script that deletes all log files content older than 30 days and append the lastest log file date in the respective logs This is my script cd... (2 Replies)
Discussion started by: sreekumarhari
2 Replies

7. Red Hat

Need Script to ZIP/SAVE & then DELETE Log file & DELETE ZIPS older than 12 months

ENVIROMENT Linux: Fedora Core release 1 (Yarrow) iPlanet: iPlanet-WebServer-Enterprise/6.0SP1 Log Path: /usr/iplanet/servers/https-company/logs I have iPlanet log rotation enabled rotating files on a daily basis. The rotated logs are NOT compressed & are taking up too much space. I... (7 Replies)
Discussion started by: zachs
7 Replies

8. Shell Programming and Scripting

Delete all files from the directory except the ones in the log file

I have a log file with contents like below. Repository: https://someserver:9443/ Workspace: (1000) "test_scripts_ws" Component: (1001) "some_Automated_Scripts" Change sets: (1002) ---$ john "test memory" 17-Sep-2014 02:24 PM Changes: --a--... (9 Replies)
Discussion started by: gaurav99
9 Replies

9. UNIX for Dummies Questions & Answers

Log file - Delete duplicate line & keep last date

Hello All ! I need your help on this case, I have a csv file with this: ITEM105;ARI FSR;2016-02-01 08:02;243 ITEM101;ARI FSR;2016-02-01 06:02;240 ITEM032;RNO TLE;2016-02-01 11:03;320 ITEM032;RNO TLE;2016-02-02 05:43;320 ITEM032;RNO TLE;2016-02-01 02:03;320 ITEM032;RNO... (2 Replies)
Discussion started by: vadim-bzh
2 Replies

10. UNIX for Beginners Questions & Answers

Delete from another file that matched on log file

I want to write a script using Oscam Cardsharing server this is my test: cat oscam.log | grep "error" sample output: 2018/10/17 16:43:07 5C94A12E p (cccam) cccam(r) test.dyndns.org: login failed, error Once I've found an error, I need to remove its information inside another file : ... (5 Replies)
Discussion started by: vzoli1987
5 Replies
TOMOYO-AUDITD(8)					  System Administration Utilities					  TOMOYO-AUDITD(8)

NAME
tomoyo-auditd - access request log recording daemon for TOMOYO Linux SYNOPSIS
tomoyo-auditd tomoyo-auditd [remote_ip:remote_port] DESCRIPTION
This program reads access request logs from the kernel and writes to the locations specified in the configuration file. By running this program at startup, access request logs for either all domains or selected domains can be stored. The format of the stored logs is similar to domain policy, so they can be used to help develop policy. Configure this daemon in /etc/tomoyo/tools/auditd.conf. If an access request matches a rule, it will be written to the specified log file. This can be used to split access request logs into multiple files. Only the first matching rule is used, so any single access request log will be written to a maximum of one output file. If an access request log does not match any rules, it will be discarded. Start this program from an appropriate stage during startup (e.g. /etc/rc.local). OPTIONS
remote_ip:remote_port Retrieve access request logs from a remote system via an agent, connecting to the specified IP address and port number. BUGS
If you find any bugs, send an email to <tomoyo-users-en@lists.sourceforge.jp>. AUTHORS
Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Main author. Jamie Nguyen <jamie@tomoyolinux.co.uk> Documentation and website. SEE ALSO
tomoyo-editpolicy-agent(8) See <http://tomoyo.sourceforge.jp> for more information. tomoyo-tools 2.5.0 2012-04-14 TOMOYO-AUDITD(8)
All times are GMT -4. The time now is 10:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy