Střípky, poskládej si to:
for DB in $(mysql -e 'show databases' -s --skip-column-names); do
mysqldump $DB > "/home/dbbackup/$DB.sql" 2>/dev/null;
done
curlftpfs ftp-user:ftp-pass@my-ftp-server /media/ftpbackup/
rdiff-backup /home/dbbackup/ /media/ftpbackup/DB/
rdiff-backup --remove-older-than 2D /media/ftpbackup/DB/
umount /media/ftpbackup/