LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-26-2010, 03:25 AM   #1
badkuk
LQ Newbie
 
Registered: Nov 2007
Posts: 12

Rep: Reputation: 0
logrotate for logs that change filenames


hi peeps,


Say that a certain server process generates log files and names them according to the current date; e.g.

server.nov-20.2010.log
server.nov-21.2010.log
server.nov-22.2010.log
server.nov-23.2010.log


i'd like to have logrotate compress the logs that are older than 3 days.

Is this possible with logrotate, or do i just schedule a cron job to bzip everything under the folder older than 3 days?

tia
 
Old 11-26-2010, 03:57 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Well if you're not rotating them in logrotate then you wouldn't really want to be miss using it. I'd just do a much simpler cron job.

find /var/log/whatever/ -mtime +3 | xargs gzip

should do it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Novell SLES logrotate doesn't rotate all my specified logs bkone Linux - Server 0 06-22-2010 03:04 PM
Logrotate doesn't rotate logs kenneho Linux - Desktop 5 03-23-2010 01:13 PM
Logrotate: Rotate Apache logs, but never delete kenneho Linux - Newbie 2 10-23-2008 07:58 AM
Logrotate: compress logs in a temp directory gbratig AIX 3 04-12-2008 11:42 PM
Script to change weird filenames yeoheric Linux - Newbie 1 03-12-2008 05:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration