(HELP) Need To Rotate Logs From Virtual Hosts on Ubuntu VPS
I have a 1gb VPS running ubuntu that I have installed Apache, Mysql and PHP.
I have 3 sites all in my home directory that are using name based virtual hosting. I have created three separate files in /etc/apache2/sites-available and enabled them via a2ensite there is also the default site in /var/www as well.
Now my concern is that each one of these sites is running about 10,000 cron jobs per day. How do make sure the logs of each of these do not grow to big and eat all the memory..?
How would I configure the log rotate and how often would one need to perform this task with 1gb of ram..?
The question in here is how often the cronjob will run. How fast the cronjob will terminate the job? There are multiple cronjobs which are running simultaneously? Do they take alot of time to complete?
Firstly make sure logrotate package is installed on your server. Normally /var/log/cron is where the cron jobs are logged into. By default rotate to this log is added to the system ( in /etc/logrotate.d/syslog ). Check if that file is present in your system and see whether /var/log/cron is listed in that. If it is listed in that, it is good.