Results 1 to 2 of 2

Thread: logrotate ignore log directories

  1. #1
    Join Date
    Dec 2011
    Thanked 0 Times in 0 Posts
    Rep Power

    Default logrotate ignore log directories


    We have an internal application that writes a lot of log files into a certain directory. In addition it also creates sub directories for each batch job where it puts batch job specific logs. The list of batch job names changes over time so the only option I found is: $APP_BASE_LOGDIR/*/*.log... This was tested and found to be working.

    My problem is that the application developer requires that rotated logs should be put in $APP_BASE_LOGDIR/archive in its original form (cannot compress or modify their format in anyway )...

    My question is: Is there a way I can put a regular expression in the path that will include all sub directories except archive?


  2. #2
    Never say die nixcraft's Avatar
    Join Date
    Jan 2005
    Thanked 824 Times in 511 Posts
    Rep Power


    Noop. However, you can move archives directory somewhere else (say /root/) using the mv command before rotating logs. Once rotated move back archives directory again to original location. See postrotate...endscript and prerotate...endscript in man page.
    All [Solved] threads are closed by mods / admin to avoid spam issues. See Howto mark a thread as [Solved]

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 18th December 2014, 06:26 PM
  2. logrotate file
    By duster in forum CentOS / RHEL / Fedora
    Replies: 3
    Last Post: 8th January 2012, 11:04 AM
  3. [Solved] wget Ignore number directory components ( parent directories)
    By mr_manny in forum Shell scripting
    Replies: 2
    Last Post: 22nd October 2009, 10:35 PM
  4. [URGENT..HELP]Please don't ignore my post. =(
    By kzapth in forum Shell scripting
    Replies: 0
    Last Post: 16th September 2007, 06:41 PM
  5. logrotate not working
    By muks in forum Web servers
    Replies: 2
    Last Post: 17th March 2007, 04:50 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts