AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
 View Only
  • 1.  Script for AIX log record

    Posted Sat July 05, 2008 06:09 AM

    Originally posted by: SystemAdmin


    Hi
    I need help to write a script for AIX which gives me the weekly log report and delete the one week old logs automatically.
    Thanks.
    A.O

    Message was edited by: aogill
    #AIX-Forum


  • 2.  Re: Script for AIX log record

    Posted Thu July 10, 2008 05:29 AM

    Originally posted by: dhraj


    Is it daily log files or will it create once in a week.
    #AIX-Forum


  • 3.  Re: Script for AIX log record

    Posted Mon July 14, 2008 07:58 AM

    Originally posted by: SystemAdmin


    It should generate daily log and delete the 7 days old record. Each day save the new log file and delete the 7 day old file.
    #AIX-Forum


  • 4.  Re: Script for AIX log record

    Posted Fri July 18, 2008 02:34 PM

    Originally posted by: SystemAdmin


    Hello,
    An easy way could be to generate the log in different directories for each day of the week. Filtering with the option "date +%A" to get the full name of week.
    And before generate the log you should clean up the directory correspond to actual day.

    Regards Leo.
    #AIX-Forum


  • 5.  Re: Script for AIX log record

    Posted Sun July 20, 2008 04:57 AM

    Originally posted by: SystemAdmin


    I need a script that will generate daily log files, arrange and save them datewise and delete the 7 days old log file automatically.
    All I have to do is to check these files after 1 week to generate the log file report.
    Thanks
    #AIX-Forum


  • 6.  Re: Script for AIX log record

    Posted Mon July 21, 2008 08:08 AM

    Originally posted by: nh4aix


    Syslog has the ability to do this already. Instead of writing your own, you could take advantage of syslog's ability to roll and manage logs..

    See http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.files/doc/aixfiles/syslog.conf.htm for info on how to configure syslog.conf to roll files..

    You can use the "logger" command to log into syslog or you can use system calls to control and log (http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.basetechref/doc/basetrf2/syslog.htm?resultof=%22%73%79%73%6c%6f%67%22%20)

    Good luck.
    #AIX-Forum