Hi all, i have found that the old log files in webxx/log folders are too big, thats why i have created this bash script to compress those files. The script is short (and ugly too, i know , but it's working ): Code: #!/bin/sh for i in `find /var/www/ -type f -mtime +2 -name web.log | grep -v "/\`date +%m\`/"` ; do gzip $i; done Run it from cron every day, after ISPConfig's log.php script (which is running 0.30 AM every day in the default installation)
mmm are this logs files usefull for something? if after the zip every is ok, i prefer to delete them...
Site gets hacked while you are away for 2 days, you can check logs if you still have them.. So yeah, they can be usefull
mmm Site has been hacked, im away two days... should i check a 2 Gb text file to see whats modified or should i restore a backup?... my choice is a backup..
If you want to avoid to be hacked for second time, then yes, you should check those 2GB text files anyway, it is up to you.
What todvard said.. but it is indeed decision made by you, if you use backup thinking that bug will be resolved by itself then fine by me..
There's also a legal reason: in some countries you must keep log files for at least a few months if you provide hosting services.
Im lucky its not here.. but anyway, my big problem is the 2Gb limit for files. Can i somehos change the script to not append everyday log file to the bi main file? i mean, save daily log in separate files?
If you split the log in daily files, you might get problems with the webalizer stats generation. You can try this by modifying the script /root/ispconfig/scripts/shell/logs.php