Try this
mysqldump -u{user name without space} -p{password without space} Database_name | gzip -9 > /home/backup_$(date +"\%Y.\%m.\%d.\%S.\%N").sql.gz 2> /home/db.log
add this line into cron job.
Pregunta
I have written a cron job for dumping my mysql database but it's not working.
Here it is.
/usr/bin/mysqldump -h localhost --user=user --password=mypass --databases dbname | gzip > /home/username/site_dir_name/uploads/backup.sql.gz
I am using cpanel.
No hay solución correcta
Otros consejos
Try this
mysqldump -u{user name without space} -p{password without space} Database_name | gzip -9 > /home/backup_$(date +"\%Y.\%m.\%d.\%S.\%N").sql.gz 2> /home/db.log
add this line into cron job.