Sponsored Content
Operating Systems Linux Debian Logrotate truncated my log files to 0 bytes and no logs are written Post 302608059 by pludi on Friday 16th of March 2012 04:01:21 AM
Old 03-16-2012
Probably the process writing to the logs has them still open, and continues to write to a file descriptior that isn't associated with a file anymore. Tell the process to reload/restart if possible, so that it re-opens the FDs. logrotate can do that with the
Code:
postrotate
...
endscript

parts in the configuration.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

restrict data from getting written to Logs

$SYBASE/bin/isql -U $DB_USERID -S $DB_SERVER << ! >> $OUTFILE `echo $DB_PASSWD` use $db go Print " The processing" go ! # Extract data to file echo $DB_PASSWD | $SYBASE/bin/bcp $WRK_DB..open out $CONV_DIR/open".csv -t\, -c -U $DB_USERID -S $DB_SERVER -b 1000 | tail -3 I am able to... (0 Replies)
Discussion started by: w020637
0 Replies

2. UNIX for Advanced & Expert Users

how to logrotate log files

Hi, I have written a script that runs every five minutes in cron schedular. The Operating system is Fedora core 9. This script generates 2 log files, these log file size is increasing as some log data is being dumped into these 2 log files every five minutes. I need to logrotate these 2 files.... (1 Reply)
Discussion started by: renuka
1 Replies

3. SuSE

Which logs to logrotate?

Hi all We've had new servers coming in and one of the requirement was to keep logs for up to 8 months. I know logrotate can do the job, but by default (on Suse Enterprise10, 11) we have these logs in /etc/logrotate.d dir as default logs which are rotated: -rw-r--r-- 1 root root 140 Jul... (0 Replies)
Discussion started by: hedkandi
0 Replies

4. Shell Programming and Scripting

Redirect all logs files contents into a single log file

Hi , I have a Data cleansing process which creates different log file for each step , when the process runs it creates following log files in below order: p1_tranfrmr_log.txt p1_tranfrmr_stats.txt p2_globrtr_log.txt p2_globrtr_stats.txt p3_cusparse_log.txt p3_cusparse_stats.txt ' '... (8 Replies)
Discussion started by: sonu_pal
8 Replies

5. Shell Programming and Scripting

Help needed on Perl Script to Handle Log files that are rotated using logrotate

Hello all, I am working on a perl script which will read weblogic logfile and send the error messages to Zenoss Monitoring tool. At present the script works and it can able to send the error messages to Zenoss. The problem comes when the logrotate has been applied to the weblogic log file. At... (3 Replies)
Discussion started by: kar_333
3 Replies

6. UNIX for Dummies Questions & Answers

X bytes of 0, Y bytes of random data, Z bytes of 5, T bytes of 1. ??

Hello guys. I really hope someone will help me with this one.. So, I have to write this script who: - creates a file home/student/vmdisk of 10 mb - formats that file to ext3 - mounts that partition to /mnt/partition - creates a file /mnt/partition/data. In this file, there will... (1 Reply)
Discussion started by: razolo13
1 Replies

7. Shell Programming and Scripting

Logrotate - I am not able to rotate files using logrotate

I have written script which is working in Home directory perfectly and also compressing log files and rotating correctly. But, when i try to run script for /var/log/ i am able to get compressed log files but not able to get rotation of compressed log files. Please suggest. I am using below command... (5 Replies)
Discussion started by: VSom007
5 Replies

8. Shell Programming and Scripting

How to disable cron emails, but only for logrotate only not for other logs?

Guys, is there a script or command? how to disable cron emails, but only for logrotate only not for other logs (3 Replies)
Discussion started by: kenshinhimura
3 Replies

9. Shell Programming and Scripting

To check if a file is open and in use (logs are being written to it)

Hello Experts, I need to write a shell script to check if a file is open and something is being written to it. I want to know how OS handles it. I checked with lsof command but it is not working. For a test I did this. while true; do echo `date` >>abc.txt; done then I checked lsof |... (5 Replies)
Discussion started by: shekhar_4_u
5 Replies

10. UNIX and Linux Applications

Logrotate with catalina.out "daily compressed file is overwriting the logs"

Hi Everyone, We are trying to do a logrotate for "catalina.out" daily, So have used the "copytruncate" option in the logrotate configuration but ended up seeing there was a 0kb file touched with "catalina.out" and the other file with the current date(compressed) file created and seems the log is... (2 Replies)
Discussion started by: thiyagoo
2 Replies
GETBUILDLOG(1)						      General Commands Manual						    GETBUILDLOG(1)

NAME
getbuildlog - download build logs from Debian auto-builders SYNOPSIS
getbuildlog package [version-pattern] [architecture-pattern] DESCRIPTION
getbuildlog downloads build logs of package from Debian auto-builders. It downloads build logs of all versions and for all architectures if version-pattern and architecture-pattern are not specified or empty, otherwise only build logs whose versions match version-pattern and build logs whose architectures match architecture-pattern will be downloaded. The version and architecture patterns are interpreted as extended regular expressions as described in grep(1). If version-pattern is "last" then only the logs for the most recent version of package found on buildd.debian.org will be downloaded. If version-pattern is "last-all" then the logs for the most recent version found on each build log index will be downloaded. OPTIONS
-h, --help Show usage information and examples. -V, --version Show version and copyright information. EXAMPLES
getbuildlog hello 2.2-1 amd64 Download amd64 build log for hello version 2.2-1. getbuildlog glibc "" mips.* Download mips(el) build logs of all glibc versions. getbuildlog wesnoth .*bpo.* Download all build logs of backported wesnoth versions. AUTHOR
Written by Frank S. Thomas <fst@debian.org>. DEBIAN
Debian Utilities GETBUILDLOG(1)
All times are GMT -4. The time now is 07:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy