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.
質問
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.
正しい解決策はありません
他のヒント
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.