When you run mysqldump , by default it will not export your procedures or function , if you want to include these info , you need to add –routines option in your mysqldump command. mysqldump <other mysqldump options> —routines > outputfile.sql Let’s assume we want to backup ONLY the stored procedures and triggers and not the mysql tables and data (this can be useful to import these in another db/server that has already the data but not the stored procedures and/or triggers), then we should run something like: mysqldump –routines –no-create-info –no-data –no-create-db –skip-opt <database> > outputfile.sql and this will save only the procedures/functions/triggers of the <database>.Read More →

There are 3 commands that we can use sar top mpstats You may need to install sysstat package to use these commands : apt-get install sysstat If you install sysstat , enable systat by edit: nano /etc/default/sysstat    -> change ENABLE from false to true.Read More →

Today, my server is out of disk and i see there are lot of files in /tmp , their names are phpXXXX , i know these  files are uploaded by PHP, but why they are not deleted after the scripts end. After a lot of troubleshooting , i found that there is some errors in my apache error log with “child process exit , filesize limit…” i did some research , and found that it’s because apache can not  work with file larger than 2GB , i searched though my file system and saw there are some of my application logs files generated files atRead More →

Today I found that Apache on my server was very slow and a lot of child pid xxxx exit signal File size limit exceeded (25) errors in error_log. It turned out that one of my applications log files are 2GB. WHen apache process read a file over than 2B it will give that error. It could be apache logs or applications log How to fix it? Let start by searching your apache logs find /var/log/apache2 -type f -size +20000k -exec ls -lh {} \; | awk ‘{ print $9 “: ” $5 }’ If you still can not find the large files – search theRead More →

You can use this command to search for files larger than 20MB on your linux box , change the number to meet your needs find / -type f -size +20000k -exec ls -lh {} \; | awk ‘{ print $9 “: ” $5 }’Read More →