473,387 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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?
Jun 2 '08 #1
4 1150
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...@example.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?
Jun 2 '08 #2
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.
Jun 2 '08 #3
On 30 Apr, 13:28, William Gill <nore...@example.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');
?>
Jun 2 '08 #4
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.
Jun 2 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: John R | last post by:
I found this old thread while looking for some type of compression solution myself. Long story short, I contacted Lester and ended up writing an LZO solution just as Mark had mentioned below....
5
by: Sandeep S. Mutalik | last post by:
Hi, Has anybody tried using compression APIs given in DB2 8.1 FP4? I would like to get more info on that. If you haven't tried it, but have some documentation about its usage, then please let me...
1
by: SStory | last post by:
Are there any functions in .NET or Windows that do file compression that I could include in a backup app I am making to sell? I have notice the LZ file operations but wonder would a developer be...
1
by: chris.atlee | last post by:
I'm writing a program in python that creates tar files of a certain maximum size (to fit onto CD/DVD). One of the problems I'm running into is that when using compression, it's pretty much...
5
by: jeremyje | last post by:
I'm writing some code that will convert a regular string to a byte for compression and then beable to convert that compressed string back into original form. Conceptually I have.... For...
20
by: chance | last post by:
Hello, I want to add compression to a memory stream and save it in an Oracle database. This is the code I have so far: //save the Word document to a binary field, MemoryStream dataStream = new...
21
by: =?Utf-8?B?VkJB?= | last post by:
I compressed a file with GZipStream class and is larger than the original file.... how can this be?, the original file is 737 KB and the "compressed" file is 1.1 MB. Did i miss something or is...
14
by: Thomas Mlynarczyk | last post by:
Hello, I have a script that generates XML files which are sent to a client app on request via "new SimpleXMLElement( $sUrl, 0, true )". Both client and server run PHP 5.2 and the XML file can...
3
by: GiJeet | last post by:
Hello, we have an app that scans documents into TIFF format and we need to transfer them over the internet. If anyone knows of a SDK we can use that can compress TIFFs on the fly or even if it can...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.