PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > Compression Functions
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Compression Functions

Réponse
 
LinkBack Outils de la discussion
Vieux 29/04/2008, 02h52   #1
William Gill
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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?
  Réponse avec citation
Vieux 30/04/2008, 02h52   #2
petersprc
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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...@example.com> wrote:
> 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?


  Réponse avec citation
Vieux 30/04/2008, 13h28   #3
William Gill
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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.
  Réponse avec citation
Vieux 30/04/2008, 14h39   #4
Captain Paralytic
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Compression Functions

On 30 Apr, 13:28, William Gill <nore...@example.com> wrote:
> 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');
?>
  Réponse avec citation
Vieux 30/04/2008, 15h13   #5
William Gill
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 11h35.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,13771 seconds with 13 queries