Does anyone have a cron job command for backing up a database that you can share?
I’ve tried repeatedly but can’t come up with a command that works.
Here’s my most recent (failed) attempt:
mysqldump --opt --user=username --password=pw --host=mysql.hostname.com database_name > backup_file_name.sql
(Where username, pw, mysql.hostname.com and database_name are placeholders for the real values.)
I’d appreciate whatever help anyone can supply.
FYI, some tables in my database recently were emptied (I don’t know how), and there was no database backup when I clicked the restore button, even though the database has been around since 2012. Fortunately, I had a fairly recent manual backup. Having a daily backup on hand would ease my mind.