First create a file called mydbbackup.cmd containing those instruction

#! /bin/sh
DATE=$(date +%d-%m-%Y_%H_%M)
/usr/bin/mysqldump -uuser -ppassword -l -q  --add-drop-table dbname > /home/myuser/backup/fileName$(DATE).sql
  • First line declare place of shell executing command
  • Second line build a variable date with the system current date (day on 2 char, month on 2 number, Year on 4 char, Hours, Minutes)
  • Then we launch the mysqldump command with full path to it, passing mysql user param and password, name of DB to save and then the path to save it.
    The file name is build on DATE var value, declared on line 2.

Then we simply need to execute this file by cron with time value to execute it in determined interval