Sponsored Content
Full Discussion: compress the log files
Top Forums UNIX for Advanced & Expert Users compress the log files Post 302360475 by skmdu on Friday 9th of October 2009 05:09:49 AM
Old 10-09-2009
compress the log files

Hi,
I have an application which creates the logs in a date wise.
like,
Code:
tomcat_access_log.2009-09-12.log
tomcat_access_log.2009-09-11.log
tomcat_access_log.2009-09-10.log
tomcat_access_log.2009-09-09.log
tomcat_access_log.2009-09-08.log
tomcat_access_log.2009-09-07.log

Now my requirement is to compress all the log files and keep only last 5 days compressed logfiles always.

For ex:
Code:
If today is 10/09/2009 ( mm/dd/yyyy)
then my log directory ( /var/log/appn) should looks like, 

tomcat_access_log.2009-10-09.log
tomcat_access_log.2009-10-08.log.gz
tomcat_access_log.2009-10-07.log.gz
tomcat_access_log.2009-10-06.log.gz
tomcat_access_log.2009-10-05.log.gz
tomcat_access_log.2009-10-04.log.gz

I tried to get it done using logrotate, but I couldn't.

It is really thankful, if you give, even some other mechanism to compress and keep only last 5 days logs.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to Compress log files?

Hi, I have my log files in /home/user1/temp2/logs i want to archive *.log and *.txt files and to store in my /home/user1/temp2/archved/ with *.log with Time stamp ,Please let me know how to do this? (1 Reply)
Discussion started by: redlotus72
1 Replies

2. Shell Programming and Scripting

Compress multiple files

Hi Friends, Can anyone help me out with compressing multiple files. I have multiple files in directory , I have to compress these into a single file, I tried using gzip -r outfile.gz file1 file2 file3. It is not working Thanks in advance for your help S :) (5 Replies)
Discussion started by: sbasetty
5 Replies

3. UNIX for Dummies Questions & Answers

Compress files

Hi All, I would like to archive some of the scripts below(USFINUM042006_01.CSV USFINUM042006_02.CSV and USFINUM042006_03.CSV )and also use a wildcard e.g. <command> USFINUM*.CSV. Also there are a lot of similar files but I want only the three latest files to be compressed. Which is the best... (3 Replies)
Discussion started by: indira
3 Replies

4. Filesystems, Disks and Memory

Compress files on NAS

Hello, I am having difficulty compressing the files using compress or GZIP utility on NAS share NFS mounted on my linux server. Any one have idea on how to do this ? I get the followign error but the trying to compress the files STRP2> compress STR_OUTBOUND_CDM_LOG_LOB.PRT2008_26.txt... (0 Replies)
Discussion started by: kamathg
0 Replies

5. Shell Programming and Scripting

compress files

Could someone give me an idea how to compress all files from a given directory that are not of type .z (compressed). Please help. (2 Replies)
Discussion started by: lesstjm
2 Replies

6. UNIX for Dummies Questions & Answers

find new files and compress them

Hi! First off I'd like to stress that I'm a true dummy :) I have a website with SSH access and since it has user generated content I want to backup my website every day end send it through FTP to a different server. I got it working for my mysql database, so the only thing remaining are the... (2 Replies)
Discussion started by: Mark Wegener
2 Replies

7. Linux

Compress files >2GB

Hi folks, I'm trying to compress a certain number of files from a cifs mount to a xfs mount, but cannot do it when the total size of the files is bigger than 2GB. Is there any limitation for above 2GB? OS is SLES 64bit The files are maximum 1MB, so there are aprox. 2000 files to compress... (2 Replies)
Discussion started by: xavix
2 Replies

8. UNIX for Dummies Questions & Answers

How to compress files without extension

Could someone please help? I'm trying to compress all the files in a directory without extension. I know for typical files with extension, the command is something like: tar -zcvf file.tar.gz *.doc What is the command for files without extension? Thanks. (4 Replies)
Discussion started by: AChan1118
4 Replies

9. UNIX for Dummies Questions & Answers

Issue: Compress in unix server and FTP to windows and open the compress file using Winzip

Hi All ! We have to compress a big data file in unix server and transfer it to windows and uncompress it using winzip in windows. I have used the utility ZIP like the below. zip -e <newfilename> df2_test_extract.dat but when I compress files greater than 4 gb using zip utility, it... (4 Replies)
Discussion started by: sakthifire
4 Replies

10. UNIX for Dummies Questions & Answers

How do I compress all files in a directory?

the problem states "Write a script that compresses all the files in the directory. Make a directory and put some files in it. Also make a sub directory in your directory and put files in it also. Once you have this basic ability to compress all files within a directory, add to your script a menu of... (1 Reply)
Discussion started by: Brittany
1 Replies
unattended-upgrade(8)					      System Manager's Manual					     unattended-upgrade(8)

NAME
unattended-upgrade - automatic installation of security (and other) upgrades SYNOPSIS
unattended-upgrade [options] DESCRIPTION
This program can download and install security upgrades automatically and unattended, taking care to only install packages from the config- ured APT source, and checking for dpkg prompts about configuration file changes. All output is logged to /var/log/unattended-ugprades.log. This script is the backend for the APT::Periodic::Unattended-Upgrade option and designed to be run from cron (e.g. via /etc/cron.daily/apt). OPTIONS
unattended-upgrade accepts the following options -h, --help help output -d, --debug extra debug output into /var/log/unattended-upgrades.log --dry-run Just simulate installing updates, do not actually do it CONFIGURATION
The configuration is done via the apt configuration mechanism, the default configuration file can be found at /etc/apt/apt.conf.d/50unat- tended-upgrades AUTHORS
unattended-upgrade is written by Michael Vogt <mvo@ubuntu.com> This manual page was originally written by Michael Vogt <mvo@ubuntu.com> COPYRIGHT
Copyright (C) 2005-2009 Canonical There is NO warranty. You may redistribute this software under the terms of the GNU General Public License. For more information about these matters, see the files named COPYING. May 4, 2009 unattended-upgrade(8)
All times are GMT -4. The time now is 04:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy