Compression Functions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • William Gill

    #1

    Compression Functions

    I want to do a quick and dirty scan of Apache logs using some of the
    zlib Compression Functions. My hosting company tars and gzips several
    other log files into the gz file. Is there an easy way, using PHP, to
    separate the files, and only process the Apache log?
  • petersprc

    #2
    Re: Compression Functions

    Hi you can exec this command

    tar xzvf logs.tar.gz access_log

    where access_log is the file you want to extract.

    Regards,

    John Peters

    On Apr 28, 9:52 pm, William Gill <nore...@exampl e.comwrote:
    I want to do a quick and dirty scan of Apache logs using some of the
    zlib Compression Functions. My hosting company tars and gzips several
    other log files into the gz file. Is there an easy way, using PHP, to
    separate the files, and only process the Apache log?

    Comment

    • William Gill

      #3
      Re: Compression Functions

      petersprc wrote:
      Hi you can exec this command
      >
      tar xzvf logs.tar.gz access_log
      >
      where access_log is the file you want to extract.
      >
      Thanks, but I don't remote access to the shell. I was hoping I could
      use the PHP compression functions to split the files, extract to a
      variable, and scan the data.

      I have been playing with gzfile() but what I'm doing seems a little
      crude.

      Comment

      • Captain Paralytic

        #4
        Re: Compression Functions

        On 30 Apr, 13:28, William Gill <nore...@exampl e.comwrote:
        petersprc wrote:
        Hi you can exec this command
        >
        tar xzvf logs.tar.gz access_log
        >
        where access_log is the file you want to extract.
        >
        Thanks, but I don't remote access to the shell. I was hoping I could
        use the PHP compression functions to split the files, extract to a
        variable, and scan the data.
        >
        I have been playing with gzfile() but what I'm doing seems a little
        crude.
        <?php
        `tar xzvf logs.tar.gz access_log`;
        ?>

        or

        <?php
        exec('tar xzvf logs.tar.gz access_log');
        ?>

        Comment

        • William Gill

          #5
          Re: Compression Functions

          Captain Paralytic wrote:
          <?php
          `tar xzvf logs.tar.gz access_log`;
          ?>
          >
          or
          >
          <?php
          exec('tar xzvf logs.tar.gz access_log');
          ?>
          Thanks I hadn't used "execution operator: backticks" but it may be a
          good place to look.

          Comment

          Working...