I made a sh in linux to extract in a compressed folder the copy of my MySql database. (Here's the sh)
#!/bin/sh
mysqldump -unombreusuario -pclave --opt nombrebd > nombrecarpeta/nombrebackup_$(date +%d%m%Y).sql
cd nombrecarpeta
tar -zcvf nombrebackup_$(date +%d%m%Y).tgz *.sql
rm nombrebackup_$(date +%d%m%Y).sql
This sh perfectly creates the folder for me.
Now, I have difficulty when doing the cron that makes the copy automatically at a certain time of the day since I can not find the file, my distribution of linux is centos and until now I do not know what else to do.