Re: vi editor question - thanks! one more

From: Lamar Saxon (Lamar.Saxon_at_AMERICREDIT.COM)
Date: 09/30/04

  • Next message: JOSEPH KREMBLAS: "Re: sudo and ulimit"
    Date:         Thu, 30 Sep 2004 11:13:08 -0500
    To: aix-l@Princeton.EDU
    
    

    tail it to a temp file then overwrite the original with the temp file...
     
    tail -n <# of lines you want to keep> hostmibd.log >
    /tmp/hostmibd.log.tmp
    cp /tmp/hostmibd.log.tmp /var/tmp/hostmibd.log
    rm /tmp/hostmibd.log.tmp
     
    Might look @ a package called TidySys on Bull's site that will do this
    for you or possibly logrotate.
     
    My concern is why the hostmibd log is so large. Should be rather small
    if it is working...
     
    Lamar

            -----Original Message-----
            From: IBM AIX Discussion List [mailto:aix-l@Princeton.EDU] On
    Behalf Of Leyden, Joseph
            Sent: Thursday, September 30, 2004 11:00 AM
            To: aix-l@Princeton.EDU
            Subject: Re: vi editor question - thanks! one more
            
            
            Thanks! that helped.
             
            one more question,
            Another file i wanted to shorten was:
             
            /etc/var/hostmibd.log
             
            but could not use vi bec "longer that 2048 char",
            need to use existing (in-use) file to keep filesystem intact,
            so how would you suggest I shorten it?
             
            Joe
             
             

                     


  • Next message: JOSEPH KREMBLAS: "Re: sudo and ulimit"

    Relevant Pages

    • Re: [Info-ingres] Re: copy and refresh the errlog.log while ingres is up
      ... NB With csh, if the variable NOCLOBBER is defined, you have to type ... after the> as it is otherwise not permited to overwrite on a ... This is true on any Unix, including Linux, Solaris etc. ... I don't know about copying /dev/null to the file, but we use "tail ...
      (comp.databases.ingres)
    • Re: uploaded files - if they already exist?
      ... so I can check the user whether to overwrite an ... If you do not use move_uploaded_file, the tempfile will be deleted when the scripts ends. ... So it is up to you to move the temp file from the temp dir to a better place. ...
      (comp.lang.php)