Answer the question
In order to leave comments, you need to log in
How to set up regular mysql database backups on the server?
There is a regular VPS hosting. We want to backup the database to external storage (for example, via FTP) on a schedule (via cron)
How are there options for how to implement this? I'm sure there are already instructions.
Answer the question
In order to leave comments, you need to log in
#!/bin/bash
filedate=$(date +%Y_%m_%d_%H_%m)
backupname="db_$filedate.sql.gz"
localbkpname="/home/user/backup/$backupname"
mysqldump -uroot -p<pass> <dbname> | gzip -9 > $localbkpname
python dbupload.py $backupname
rm $localbkpname
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question