Professional Web Applications Themes

rotating logs and open handle (webstats) - Linux / Unix Administration

Hi I did use the tail command in a small script to rename access_log in acces_log.1 and keep the last lines of access_log.1 to create a new access_log. What happen now is that apache has an open handle to former access_log and it will continue to output requests (in access_log.1 this time) instead of the newly created access_log unless I restart the apache server. Any way to do this with a more elegant method?...

  1. #1

    Default rotating logs and open handle (webstats)

    Hi

    I did use the tail command in a small script to rename access_log in
    acces_log.1 and keep the last lines of access_log.1 to create a new
    access_log.
    What happen now is that apache has an open handle to former access_log
    and it will continue to output requests (in access_log.1 this time)
    instead of the newly created access_log unless I restart the apache
    server. Any way to do this with a more elegant method?

    jean-francois Guest

  2. #2

    Default Re: rotating logs and open handle (webstats)

    In comp.unix.admin jean-francois <com>: 
     

    Yep.

    man rotatelogs

    ROTATELOGS(8) rotatelogs ROTATELOGS(8)

    NAME
    rotatelogs - Piped logging program to rotate Apache logs




    --
    Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
    mail: echo qr | perl -pe 'y/a-z/n-za-m/'
    #bofh excuse 102: Power company testing new voltage spike
    (creation) equipment
    Michael Guest

  3. #3

    Default Re: rotating logs and open handle (webstats)

    Michael Heiming wrote: 
    >
    > [/ref]

    cp access_log access_log.1 

    JohnK

    --
    ABSURDITY, n.
    A statement or belief manifestly inconsistent with one's own opinion.
    Ambrose Bierce, The Devil's Dictionary.
    JohnK Guest

  4. #4

    Default Re: rotating logs and open handle (webstats)

    In comp.unix.admin JohnK <com>: 
    >>
    >> [/ref][/ref]
     [/ref]

    gzip -9 access_log.1 # if available

    You gave to admit, *rotatelogs* which comes with apache has
    several advantages about doing it manually.

    BTW
    You might like to check how to go about quoting.

    --
    Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
    mail: echo qr | perl -pe 'y/a-z/n-za-m/'
    #bofh excuse 393: Interference from the Van Allen Belt.
    Michael Guest

Similar Threads

  1. rotating jaw deformation
    By Roofy in forum Macromedia Director 3D
    Replies: 9
    Last Post: July 12th, 08:22 PM
  2. Rotating
    By Yohan webforumsuser@macromedia.com in forum Macromedia Director 3D
    Replies: 7
    Last Post: January 29th, 04:21 PM
  3. Cannot open Elements "handle is invalid"
    By Sandra_Honeyman@adobeforums.com in forum Adobe Photoshop Elements
    Replies: 13
    Last Post: November 3rd, 08:29 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139