just add :
Code:
. /path/to/cred.cnf
... at top of script, under export... line
(note: there is a space after dot)
then modify also:
Code:
mysqldump --user=$DB_USER --password=$DB_PASSWD ...
to:
Code:
mysqldump --user=$user --password=$pass ...
(so user and pass variable are defined in cred.cnf)
(edit)
Or uncomment
Code:
#export DB_USER=user
#export DB_PASSWD=pass
(but I don't see the advantage of using more variables)