Score:-1

Automatic backups of MySQL database with Cronjob

eg flag

I would like to backup my MySQL database with a cron job, but I cannot make it work.

This is the code that I am using:

0 2 * * * mysqldump -u root toko_db | gzip > /var/backup/toko_db_`date '+%Y-%m-%d'`.sql.gz
hr flag
See [Command with percent symbols not running in crontab](https://askubuntu.com/questions/433866/command-with-percent-symbols-not-running-in-crontab)
Score:0
in flag

The date section for the file name seems malformed. Perhaps you could try this:

0 2 * * * mysqldump -u root toko_db | gzip > /var/backup/toko_db_$(date +\%Y-\%m-\%d).sql.gz

Remember to send that file to another location so that you have a recent backup in the event the entire server disappears.

SEOSatu avatar
eg flag
thank for, answer . it work
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.