|
#1
|
|||
|
|||
|
apache 2.0.59 query about log files windows xp pro
Hi My personal webserver sits in a corner chugging along,and its headless I access it through ftp.I was wandering is there a way for my apache log files to be automatically sent from my webserver to my main Desktop pc automatically.
Regards Nige.
__________________
Linux User:426178 |
|
#2
|
||||
|
||||
|
You could use a batch file to email the log to you.
First, you will either need SMTP access to an email server (eg. Gmail, or your ISP email account), or be running your own mail server (see here, here or here for free ones). Next you will need a command line mailer. For the sake of consistency, if you use Blat, you can copy the code I give you. Put the following in a batch file: Code:
@echo off
::Get date to a YYYYMMDD format (needs modifying for non-US date formats)
FOR /F "TOKENS=1* DELIMS= " %%A IN ('DATE/T') DO SET CDATE=%%B
FOR /F "TOKENS=1,2 eol=/ DELIMS=/ " %%A IN ('DATE/T') DO SET mm=%%B
FOR /F "TOKENS=1,2 DELIMS=/ eol=/" %%A IN ('echo %CDATE%') DO SET dd=%%B
FOR /F "TOKENS=2,3 DELIMS=/ " %%A IN ('echo %CDATE%') DO SET yyyy=%%B
SET dat=%yyyy%%mm%%dd%
::Copy Apache logs and stamp with date string. Erase old logs (Apache will make new ones)
::May have to stop Apache first
cd "c:\path\to\logs\folder\"
copy access.log %dat%_access.log
copy error.log %dat%_error.log
del access.log
del error.log
::Compress logs
::Email logs
c:\blat\full\blat -body "Here are today's logs" -subject "Apache Logs" -to you@mail.com -server localhost -f you@mail.com -attach %dat%_access.log -attach %dat%_error.log
If your logs get big, you'll want to compress them - 7-Zip would be handy to use since it will happily compress files using the command line. Its commands are documented too. Also make sure that your messages aren't being marked as spam by your mail host, it will be the source of many frustrations (like it was for me while testing these procedures).
__________________
Oracle's backup tutorial "A lot of people say games are addictive. Well, they're addictive in the sense that anything you like doing you repeat endlessly. But no one would say, 'Mr Kasparov, you have a chess problem,' or 'Tiger Woods, you have a golf addiction.'" - Ian Livingstone, Creative Director, Eidos. "A problem well stated is a problem half solved" - Charles Franklin Kettering |
|
#3
|
|||
|
|||
|
Thats a fantastic reply i will give it a shot.
Cheers oracle128 ps How does one come up with a username like oracle128. Regards Nige.
__________________
Linux User:426178 |
|
#4
|
||||
|
||||
|
No problem.
It's a combination of oracle (a wise, prophetic mystical being) and the amount of RAM in the computer I was using at the time (I needed a number since "oracle" was already taken). This was back in the days when ICQ was popular.
__________________
Oracle's backup tutorial "A lot of people say games are addictive. Well, they're addictive in the sense that anything you like doing you repeat endlessly. But no one would say, 'Mr Kasparov, you have a chess problem,' or 'Tiger Woods, you have a golf addiction.'" - Ian Livingstone, Creative Director, Eidos. "A problem well stated is a problem half solved" - Charles Franklin Kettering |
![]() |
| Bookmarks |
«
Previous Topic
|
Next Topic
»
| Topic Tools | |
|
|
All times are GMT +1. The time now is 07:00 PM.
[
RSS ]








