dotlike.net
 

NAVIGATION

PROJECTS

ITKB
 


MySQL - purge mysql binary logs with crontab


Here is a simple one-liner for use with crontab or directly from command line to purge the MySQL binary logs which are older than 1 day to reclaim disk space.

# mysql purge binary logs (older than 1 day)
mysql -e "PURGE BINARY LOGS BEFORE `date --date='1 days ago' '+%Y-%m-%d'`;" DATABASE   -pPASSWORD -uUSER



    Article Details:

    FileID : 19
    Keywords : mysql; binary logs; cleanup; crontab; purge;
    Authored by : davidr
    Views : 6755
    Submit Date : 2011-12-11 14:15:55
 
ETCETERA

Valid HTML 4.01 Transitional

http://twitter.com/dotlike