In the crontab I put the following:
30 2 * * 0,2,4,6 /usr/local/axisutilities/removelogs.sh
My script is like this:
#!/bin/bash
/usr/local/mysql/bin/mysql -paxismobile < /usr/local/axisutilities/deletelogs.sql
Which calls the following file.
Deletelogs.sql:
PURGE MASTER LOGS BEFORE now() -interval 24 hour;
PURGE BINARY LOGS BEFORE now() -interval 24 hour;
exit