Article View: es.comp.os.linux.programacion
Article #9030script en PHP
From: Berny
Date: Sun, 15 Sep 2002 14:59
Date: Sun, 15 Sep 2002 14:59
27 lines
1726 bytes
1726 bytes
estoy empezando a hacer mis primeros pinitos con PHP y tengo una web alojada
en un servidor linux en el que puedo programar tareas en el crontab.
Quiero crear un script que todos los dias haga una copia del log del dia
anterior y lo guarde donde yo le diga, para de vez en cuando bajarmelo....
He creado el siguiente script:
<?php
$dateshort = date("Ymd")
$datelong = date("d/M/Y")
system ("grep $datelong /usr/local/apache/domlogs/edonkeycentral.com >
/home/edonkey/logs/accesslog$dateshort.log");
system ("tar cvzf accesslog$dateshort.tar.gz accesslog$dateshort")
system ("rm accesslog$dateshort")
?>
Ni siquiera se si funciona.... porque ya me he dado cuenta de que esto saca
el log del dia actual y no del anterior :-(
Echarme una manita....
Muchas gracias !!!!
--
Berny
http://www.eDonkeyCentral.com
Technical Details
Message-ID:
<am278u$1v6i9$1@ID-94826.news.dfncis.de>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsmi-us.news.garr.it!newsmi-eu.news.garr.it!NewsITBone-GARR!fu-berlin.de!uni-berlin.de!213-4-13-230.uc.nombres.ttd.ES!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII-7-bit X-Google-Thread: f86c8,ed906a9a8b411874,start X-Google-Attributes: gidf86c8,public X-Google-ArrivalTime: 2002-09-15 07:59:46 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsmi-us.news.garr.it!newsmi-eu.news.garr.it!NewsITBone-GARR!fu-berlin.de!uni-berlin.de!213-4-13-230.uc.nombres.ttd.ES!not-for-mail From: "Berny" <Bernardo_AchiricaNOSPAM@NanoP3.com> Newsgroups: es.comp.os.linux.programacion Subject: script en PHP Date: Sun, 15 Sep 2002 16:59:38 +0200 Lines: 31 Message-ID: <am278u$1v6i9$1@ID-94826.news.dfncis.de> NNTP-Posting-Host: 213-4-13-230.uc.nombres.ttd.es (213.4.13.230) X-Trace: fu-berlin.de 1032101984 2071113 213.4.13.230 (16 [94826]) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000