Domanda

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.

Nessuna soluzione corretta

Altri suggerimenti

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top