Sentora Support Forums
Sentora log files getting rather large - okay to delete? - Printable Version

+- Sentora Support Forums (https://senforums.mach-hosting.com)
+-- Forum: Sentora Forum Archives (https://senforums.mach-hosting.com/forumdisplay.php?fid=5)
+--- Forum: Sentora Public Support Forums v1.0.x (https://senforums.mach-hosting.com/forumdisplay.php?fid=32)
+---- Forum: General Support Forum v1.0.x (https://senforums.mach-hosting.com/forumdisplay.php?fid=36)
+---- Thread: Sentora log files getting rather large - okay to delete? (/showthread.php?tid=2777)



Sentora log files getting rather large - okay to delete? - americanninja - 04-19-2016

So I have noticed my server is starting to accumulate a good amount of diskspace. So I was searching around the server today to see what folders were getting bloated and I came across /var/sentora/logs folder. It seems that the content in the folder /var/sentora/logs/domains is taking up around 3.5 GB of space.

Currently this web server is simply hosting about 6 websites with a total of 5.4GB of disk space being used.

How can I reclaim the 3.5 GB in the logs folder. Does Sentora clear this automatically or do I need to go in and delete. Is it safe to just delete the entire /var/sentora/logs/domains folder?

Looking forward to any help. Thank you!


RE: Sentora log files getting rather large - okay to delete? - bbspike - 04-19-2016

Use this:

http://forums.sentora.org/showthread.php?tid=2211&highlight=logrotate


RE: Sentora log files getting rather large - okay to delete? - americanninja - 04-19-2016

(04-19-2016, 05:44 PM)bbspike Wrote: Use this:

http://forums.sentora.org/showthread.php?tid=2211&highlight=logrotate

Thanks BBspike! Actually, I came across several issues with the configurations on that page. After testing things, I finally got everything working. I will post here shortly for anyone else looking for this answer.


RE: Sentora log files getting rather large - okay to delete? - americanninja - 04-19-2016

(04-19-2016, 12:53 AM)americanninja Wrote: So I have noticed my server is starting to accumulate a good amount of diskspace. So I was searching around the server today to see what folders were getting bloated and I came across /var/sentora/logs folder. It seems that the content in the folder /var/sentora/logs/domains is taking up around 3.5 GB of space.

Currently this web server is simply hosting about 6 websites with a total of 5.4GB of disk space being used.

How can I reclaim the 3.5 GB in the logs folder. Does Sentora clear this automatically or do I need to go in and delete. Is it safe to just delete the entire /var/sentora/logs/domains folder?

Looking forward to any help. Thank you!

So I referred to the other commentors thread to get an idea of what I had to do. Some of the code seemed to have issues with Ubuntu and the permissions. I have installed Sentora by default on a server with version 1.0 on ubuntu. So if you have Ubuntu and having trouble with the other thread, please have a look at the config code I used on my server.

Code:
nano /etc/logrotate.d/Sentora-apache

Then paste this in the file:
Code:
/var/sentora/logs/domains/*/*access.log /var/sentora/logs/domains/*/*bandwidth.log /var/sentora/logs/domains/*/*error.log /var/sentora/logs/zpanel.log /var/sentora/logs/sentora*.log /var/sentora/logs/daemon*.log { su root root weekly size 100M missingok rotate 2 compress delaycompress notifempty create 664 root root sharedscripts postrotate /etc/init.d/apache2 reload > /dev/null endscript }

Code:
nano /etc/logrotate.d/Sentora-dovecot

Paste this in the file:
Code:
/var/log/dovecot*.log { su root root weekly size 100M missingok rotate 5 compress delaycompress notifempty create 660 vmail mail sharedscripts postrotate doveadm log reopen endscript }

Code:
nano /etc/logrotate.d/Sentora-proftpd

Code:
/var/sentora/logs/proftpd/access.log /var/sentora/logs/proftpd/auth.log /var/sentora/logs/proftpd/xferlog.www { su root root weekly size 100M missingok rotate 5 compress delaycompress notifempty create 644 root root sharedscripts postrotate # reload could be not sufficient for all logs, a restart is saf$ /etc/init.d/proftpd force-reload > /dev/null endscript }

This should work on Ubuntu with Sentora v1.0. Be sure to check if the file creation lines specifying permissions owner and group are correct. Refer to the files in that folder to make sure they match.

To confirm things are working run logrotate command like this:
Code:
logrotate -v /etc/logrotate.d/nameof-file

You should see new files in the directory if they were rotated. Then you can check to see if was rotated here as well:
Code:
cat /var/lib/logrotate/status