MySQL incremental backups can be acheived using the --log-bin
option. For more information about that and for the original source of the following code, please see the mysql ref. manual.
Now to the code:
I added some logging to the script
[ad#ad-1]
#!/bin/bash
MODE=$1
MYSQLUSER=backup
FTPUSER=ftpuser
FTPPASS=ftppass
BINLOGPATH=/var/lib/mysql
BINLOGNAME=mysql-bin
ARCHIVEPATH=/var/data/backups/mysql/