How to set up corn job in ispconfig for purging mysql.log?

Discussion in 'Installation/Configuration' started by strang3r, Jan 12, 2015.

  1. strang3r

    strang3r Member


    I am using Debian Wheezy 64bit with ISPConfig 3.

    Recently I am monitoring that my hard drive size went from 4.9gb to 7.6gb used. But I don't have that much size of website hosted in. I looked and I found out that in var/log/mysql.log it got size of 2.66gb. And I am thinking this one made that extra sizes. I am not sure if this is safe to be remove or if it will return back after it get remove. But I want a better solution so I can just purging it's data through corn job.. without completely deleting this file. Any suggestion would be great on how do I set this thing up so I can purge it weekly. Kindly please respond. Not an expert on this but love to learn.
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You should disable the mysql.log, it is only used for debugging and will slow dosn your server as it logs was too much details (allsql queries). Disable that log in mysql my.cnf file and emove that log file afterwards.
  3. strang3r

    strang3r Member

    Sorry for noob question but in some other random website I heard that by removing this mysql.log file, it could break my mysql setup?.
    Also will be I able to use syslog after disabling/removing this mysql.log?. Because I always do use Monitor: Server State and All Logfiles options of ISPConfig 3 control panel..
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Thats why you have to disable it first and restart mysql. Then check with:

    tail -f /var/log/mysql.log

    if no new lines get added anymore when you access a website that uses mysql. If no lines get added, then the log is disabled and can be removed.

    Sure. Syslog and mysq.log are two different logs.
  5. strang3r

    strang3r Member

    I cannot check that file as it is too big... 2.67gb. But I have disabled general log and restart mysql db. After that renamed that log into a bk file name. Visited a website using mysql db... and now it is not recreating any mysql.log file after that. Looks like this solution worked :)
    But I do have some Gzip files already in var/log/mysql/ . eg: mysql.log.1.gz, mysql.log.2.gz, mysql.log.3.gz. etc

    Can I remove this also?.
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    You can remove the gzipped files as well.

Share This Page