|
|
Backup Apache log files
Is there anything improper about using the hint script w/ "sudo apachectl graceful" as the last line rather than the piped /usr/sbin/rotatelogs - especially on a low traffic server? I like the idea of defining my own backup filename and frequency (like 1st of the month, rather than # of seconds). Also, if cron runs this script and the script is owned by root, does it need the sudo command?
Backup Apache log files
Read: the log rotation section of Apache's manual. Also check out cronolog.
Backup Apache log files
It's generally not a good idea to have automated scripts running/owned by by root unless you really have to, especially on a machine that you're exposing to the net. Change permissions on the directory to be writeable by a different user, who doesn't have permission to do much, and run the script as that. The filenames output by rotatelogs are the filename supplied with a time/date stamp in unix epoch format. From managing servers for a while, I found rotating daily/weekly is preferable to monthly, as you can miss occasional corruption if you let it go too long, and most stats packages are as happy working on collections of files as individual files, and you can write a script to compress the inactive files with gzip/perform backups on yesterdays files. Crucially, there's no need to interrupt the server if it's doing the rotation for you. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:Hints1 new Hints in the last 24 hoursComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.05 seconds |
|