The following script handles my hourly backup of my MySql. It performs the following steps: 1) Deletes the previous backup(s) 2) Tars and compresses contents of /var/lib/mysql 3) Copies (via Samba) the resulting tar (For example NS13-hourly-backup-16-June-2004-09.tar.gz)to a Windows XP box (Burner) share (bup).
Why not use mysqldump? That takes care of most locking issues, allowing you to do a "hot" backup. The output is a text SQL source file, which is tar'd at high compression. I do that every night on a web host and scp the tarball to /tmp on my home gateway. tmpwatch then takes care of removing the old backups.