mysqldump with automatically generated export name When I do database dumps through MySQL WorkBench it picks a filename for me which is the current date (YYYMMDD).

Now, I want to do this in a batch file since I want to make weekly dumps automatically by simply running a simple script (our DB is running on a windows machine)

Do I have to make the filename myself or is there a way to have mysqldump do it for me? I can use date /t and parse it but it would be nice to know if there was some built-in functionality.
Here a script i have running my database backup :
-it create daily zipped bkps  in their onw daily data dirs.
-it may look strange that no passw in the conf ! is because i have configured my user root to run mysqldump without asking for password(this is for security reasons- you don't what your OS admin to sniff the process and see the password :))

To configure 
password less access just create a .my.cnf file in your root home dir containing :

[mysqldump]
user = root
password = password 


Script 

 #!/bin/bash
        #Script backup mysql individual
        USER="root"
        DIR="`date | awk {'print $2"_"$3"_"$6'}`"
        PWDDIR="/mysql/backup_mysql/_mysqldump/"
        FINALDIR="$PWDDIR$DIR"
        GZIP_ENABLED=1
        GZIP="/bin/gzip"
        MYSQLDUMP="/usr/bin/mysqldump"
        MYSQL="/usr/bin/mysql"
        mkdir $FINALDIR
        databases=`$MYSQL --user=$USER -e "SHOW DATABASES;" | grep -Ev "(Database|information_schema)"`

        for db in $databases; do
            echo $db
                if [ $GZIP_ENABLED == 1 ]; then
                        mysqldump --force --opt --user=$USER  --databases $db | gzip &gt; "$FINALDIR/$db.gz"
                else
                    mysqldump --force --opt --user=$USER  --databases $db &gt; "$FINALDIR/$db.sql"
                fi
        done



the script will create data dir for every day: 


drwxr-xr-x 2 root root 4096 Mar 13 02:00 Mar_11_2014



Windows version for a nice mysqldump follow this link