Re: get the timestamp as a log filename

From: Robin Laing (Robin.Laing_at_drdc-rddc.gc.ca)
Date: 01/22/04

  • Next message: Christoph Wickert: "RE: problem removing Mozilla 1.4 which came with FC1"
    To: fedora-list@redhat.com
    Date: Thu, 22 Jan 2004 13:17:09 -0700
    
    

    Genti A. Hila wrote:
    > I think I didn't explain it quite well:
    > I have some log files that are saved from logrotate hourly.
    > But what i get is something like message.1 messages.2 etc
    > Instead of this i would like to have something like
    > mesagges_04\01\21_14\00
    > messages_04\01\21_13\00
    > So to follow the format messages_yy\mm\dd\_hour\minute
    > Something like that, the idea is to have the time as the name of the file
    >
    >
    > Genti
    >
    >
    You may have to write a script to run as part of the logrotate
    configuration. There is an ability to have a script execute after the
    rotation.

    There are different ways of calling the script.

    I am not sure if the "extension" will work for what you want.

    Maybe this would be better as a cron feature than logrotate as it
    sounds that you want to keep a running record of log files, not just
    rotate them.

    -- 
    Robin Laing
    -- 
    fedora-list mailing list
    fedora-list@redhat.com
    To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
    

  • Next message: Christoph Wickert: "RE: problem removing Mozilla 1.4 which came with FC1"

    Relevant Pages

    • Re: Size of wtmp files
      ... for logrotate to configure it the way you want. ... > a script to run 'last' repeatedly on zcatted versions of the rotated files, ... an attacker has full reign to edit the log files with impunity. ...
      (comp.os.linux.misc)
    • Re: Size of wtmp files
      ... >> SuSE 7.2 runs cron.daily, which among other things, rotates ... Not using logrotate - suse 7.2 simply used a script. ... an attacker has full reign to edit the log files with impunity. ...
      (comp.os.linux.misc)
    • Re: How to to define the size of a file in scripting
      ... I am writing a small script for log files ... compress $logtest ... I don't know about logrotate. ...
      (comp.unix.shell)
    • Re: Move files in order
      ... Bill S. wrote: ... >> There is a script specifically for this, called logrotate. ... If the relevant log files are in your log directory, ...
      (comp.os.linux.misc)
    • Re: syslogd that can rotate file based on size in bytes
      ... In that case, just make logrotate run ... How would you tell logrotate to run every 5 minutes and to rotate only if the log file is larger than, say, 2 MB? ... By doing it in a separate program with general support for rotating ... log files, you can rotate all the log files with one mechanism ...
      (comp.unix.programmer)