Informix

 View Only
  • 1.  change_MSGPATH.sh

    Posted Thu March 25, 2021 09:06 AM

    I really like having my Informix log in separate files for each day, like this:

     

    -rw-rw-r--.  1 informix informix   2407 Mar 19 23:00 online-21-03-19.log

    -rw-rw-r--.  1 informix informix   2408 Mar 20 23:00 online-21-03-20.log

    -rw-rw-r--.  1 informix informix   2688 Mar 21 23:00 online-21-03-21.log

    -rw-rw-r--.  1 informix informix   2406 Mar 22 23:00 online-21-03-22.log

    -rw-rw-r--.  1 informix informix   4527 Mar 23 23:00 online-21-03-23.log

    -rw-rw-r--.  1 informix informix  10436 Mar 24 16:56 online-21-03-24.log

     

    I accomplish this with the following lines, which I have in a shell script that I named "change_MSGPATH.sh"

     

    #!/bin/sh

    . /etc/profile

     

    # Give the Informix log a new name based on today's date.

    # This script runs just after midnight every night.

     

    dateinfo=`date +"%y-%m-%d"`

    onmode -wf MSGPATH=$INFORMIXDIR/online-$dateinfo.log

     

     

     

    The cron job that runs this shell script:

    1 0 * * * /home/informix/shells/change_MSGPATH.sh  > /dev/null 2>&1

     

     

    clerk11s

    John Dargan, Database Administrator II - Information Technology

    LAURA E. ROTH, Clerk of the Circuit Court

    Seventh Circuit, Volusia County, Florida

    Phone: 386-822-5004

     

    image002.jpg@01D3169F.07A71D40

    Have I helped you today? Please take the Survey!

     

     

     

     


    #Informix


  • 2.  RE: change_MSGPATH.sh

    IBM Champion
    Posted Thu March 25, 2021 09:17 AM
    Great post and sharing!

    For what it's worth, there is a Task Manager task, "online_log_rotate", that does this for you and you can set the frequency of the message log change and the maximum number of history logs to keep before deleting older ones.

    Art


    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 3.  RE: change_MSGPATH.sh

    IBM Champion
    Posted Thu March 25, 2021 09:50 AM
    Neat but you can do the same thing with logrotate

    Cheers
    Paul

    Paul Watson
    Oninit LLC
    +1-913-387-7529
    www.oninit.com
    Oninit®️ is a registered trademark of Oninit LLC