PDA

View Full Version : when are logs deleted?


lucas
10-10-2002, 01:34 PM
when are the raw logs deleted? i seem to have missed it last month when i tried to download it on the last day of the month.

Steven
10-10-2002, 01:58 PM
Lucas,
They are deleted monthly, then the cycle starts again.

-Steven

lucas
10-10-2002, 02:16 PM
steven,

i'm really looking for an exact day of the month and time. so the last day of the month at 11:59? :D

Steven
10-10-2002, 02:31 PM
Well to be exact, I would say 11:59 pm on the last day of the month server time, which is PST.

-Steven

lucas
10-10-2002, 09:40 PM
can you help me write a cron job that copies the logfile from its directory to another user defined folder? i looked at websites for a hour today and all they talk about is the time format of cron. :(

Steven
10-10-2002, 09:47 PM
Originally posted by lucas
can you help me write a cron job that copies the logfile from its directory to another user defined folder? i looked at websites for a hour today and all they talk about is the time format of cron. :(

Sorry Lucas,
but you are on your own on this one. You might put in a request for other members to write you a script, as that may be a viable alternative. Or search more on what syntax to use in the cron.

-Steven

Simon
06-01-2003, 06:46 PM
[OLD THREAD ALERT]

Just wondering about this problem myself. I'm interested in saving my raw log files, but they seem to be deleted at the end of each month. Is that correct Steven? It seems that the statistical analyzers parse the logs and then they are deleted - are there no backup copies anywhere?

Using a cron job to copy the logs should work OK, but you may still miss a few lines of the logs from visitors who access the site in the last few minutes of each month.

Something like this should make a copy of the logs...
59 23 28,30,31 * * /bin/cp /path/to/logfile /my/path/access-log.`/bin/date +%m`.log

(I haven't tested it yet...)

Alternatively I could write a PHP script which could do the same thing. Then use cron to call the PHP script.

Steven - is there any other solution to prevent us losing our visitor history (in raw form) forever?

If not - what are the paths to the logs and to our home directories, so that we can run a copy? (Are our homes at /home/username ?)

Another alternative is to dump the data into a MySQL table. I'll attempt to set this up via a cron too.

< Simon >

Simon
06-01-2003, 07:27 PM
OK, I tested the concept of copying through cron and it works, though you need a backslash before the percent sign.

And a user's home directory is /home/user I found out. Now I just need to know where the logs are kept.

< Simon >

Simon
06-01-2003, 07:28 PM
Another thought I had - is it possible to specify an additional log location through .HTACCESS? Anyone know?

< Simon >

Steven
06-01-2003, 10:17 PM
Yes, we delete your raw access logs at the end of every month, so it is best to use a cron script to download that log file before the end of the month :) We do this since it doesn't make sense to waste disk space with all the raw access logs, since you can have a script download them.

-Steven

altatech
06-02-2003, 07:17 AM
FYI, using the latest update of CPanel which is already installed in my server (diablo) you can select the option to archive logs of previous months ;)

Steven
06-02-2003, 10:17 AM
Originally posted by altatech
FYI, using the latest update of CPanel which is already installed in my server (diablo) you can select the option to archive logs of previous months ;)

Yes, we are aware of that as it has been in there for a while, but just so you guys are aware the raw access logs of a server are HUGE, and there is no way we could save them, because they take up too much space, even with 200gb hard drives.

-Steven

Simon
06-02-2003, 09:45 PM
Steven - perhaps at the end of a month the logs could be GZipped and then stored for one more month, after which it is deleted. This way we'd still have access to a complete log file, but not waste too much space.

I noticed that a 2meg log file I downloaded was only 100kb gzipped (that's 5% of normal size).

Would this be an option? If not, could you let me know the directory where logs are stored and I'll try and work out my own hack. :cool:

< Simon >

altatech
06-03-2003, 01:29 AM
Simon, you don't need a hack! You can do it directly from your CPanel :) The log files will automatically be zipped and will count against your space...

Simon
06-03-2003, 03:44 AM
How? I haven't seen that option anywhere.

< Simon >

altatech
06-03-2003, 04:30 AM
There should be a "raw log manager" link in your CPanel. If not, the skin you are using needs an update. ;)

Simon
06-05-2003, 05:53 PM
OK, yeah my skin wasn't showing that option (GreySim). I changed to BlueLagoon which shows that option now.

Thanks for the tip!

Another question: does it archive the logs in plain text format, or GZipped?

< Simon >

altatech
06-06-2003, 05:13 AM
GZipped ;)

mwproductions
12-31-2005, 10:01 AM
Sorry to dredge this all up again, but I'm trying to d/l the raw log and am having a problem.

The gzipped file gets d/led just fine, but when I unzip it, there is an executable inside that, when I try to execute it, returns an error stating that the CPU has "encountered an illegal instruction."

Any ideas?

I haven't had to deal with raw logs before, so I'm not sure if there's something I'm doing wrong or not.

Thanks in advance!

mwproductions
01-02-2006, 03:26 PM
I got it sorted.

Just in case anyone else has this problem, Windows was viewing the .com in the name of the file as its extension. To fix this, simply rename the file to end in .log and all should be well.