Archiving Logs

 
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
cenocre
-


Joined: 12 Mar 2007
Posts: 47

PostPosted: Fri Jul 06, 2007 8:57 am    Post subject: Archiving Logs Reply with quote

Is there any way to have automated daily or weekly log archiving?

If not, this is a big missing feature, so please Aprelium add log archiving. We really need it.
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sat Jul 07, 2007 3:21 pm    Post subject: Re: Archiving Logs Reply with quote

cenocre,

You can do that by an exetrnal script which has to be executed daily or weekly (using Windows Task Scheduler or Cron on Unix-like system). The script will stop Abyss Web Server, archive the logs, compress them (or do whatever required), and restart Abyss Web Server.

Such a script is listed in http://www.aprelium.com/forum/viewtopic.php?p=39369#39369 .
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
cenocre
-


Joined: 12 Mar 2007
Posts: 47

PostPosted: Sat Jul 07, 2007 5:30 pm    Post subject: Reply with quote

I'm on a Mac so I quess I'll have to write a cron script. The hassle is having rewrite the script every time I add a domain to the dozens we already host.

In the reply in 2005, you said, "A log rotation system will be added in a future release." Is that still in the plans? I hope so. I would like for it to be able to save the archived logs to a separate directory.

It would be great as it is a standard feature in all the other server software we run. We archive the logs daily to a separate server machine that just runs the log analysis software for a bunch of servers and the archived logs are saved there automatically just by setting the path when setting up a virtual host. No external programs or scripts needed.
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Mon Jul 09, 2007 2:18 pm    Post subject: Reply with quote

cenocre wrote:
I'm on a Mac so I quess I'll have to write a cron script. The hassle is having rewrite the script every time I add a domain to the dozens we already host.


You could use wildcards to make things automatic. For example, if log files are stored in /X/Y/access-site1.log and /X/Y/access-site2.log, you can use the following commands (Shell commands) to perform a set of actions on these files:

Code:

# for each log file
for f in /X/Y/access-*.log; do
     # move the log file to  /X/archive
     mv $f /X/archive
     # Compress it
     gzip -9 /X/archive/$f
done


This way, whenever you add a new host, set its log file to be named /X/Y/access-whatever.log and the script will take care of it automatically.

Quote:
In the reply in 2005, you said, "A log rotation system will be added in a future release." Is that still in the plans? I hope so. I would like for it to be able to save the archived logs to a separate directory.


It is still in our plans. But it has been postponed because some other features generated more requests by our users so they got higher priority.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
cenocre
-


Joined: 12 Mar 2007
Posts: 47

PostPosted: Tue Jul 10, 2007 8:31 pm    Post subject: Can path in script use a variable? Reply with quote

Thanks for the script idea; however, I don't see that that solution would work in this situation as there is not a common path to the logs or the archives. Each log has a unique path.

Each site has a log folder so that clients can download their logs. And, the logs are also stored in a unique folder for each site on the machine that runs the log analysis software.

Since the path is based on the domain name perhaps there would be a way to fill a variable, but my shell scripting skills are rudimentary.

A path looks like this within each site root folder with the log folder matching the domain name: /logs/CLIENTDOMAIN.COM/logfile

And like this for other server: /Volumes/logserver/logs/CLIENTDOMAIN.COM/logfile
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Thu Jul 12, 2007 10:18 pm    Post subject: Re: Can path in script use a variable? Reply with quote

cenocre wrote:
Since the path is based on the domain name perhaps there would be a way to fill a variable, but my shell scripting skills are rudimentary.

A path looks like this within each site root folder with the log folder matching the domain name: /logs/CLIENTDOMAIN.COM/logfile

And like this for other server: /Volumes/logserver/logs/CLIENTDOMAIN.COM/logfile


The script could be changed in that case to:

Code:
# for each log file
for f in /logs/*/logfile; do
     # copy the log file to  the other server
     cp $f /Volumes/logserver$f
    # Delete the original
    rm $f
done

_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group