gerryvz
Well-known member
This is the command I use as a cron job for a daily rolling backup of my main XF database. Each day it replaces the day of the week as a new backup, and writes over the backup done the same day the previous week. Everything is automatically backed up once a day via my VPS provider (Linode), and once a week I download a copy to my local hard drive (for cloud and two other types of backup).
This is with Ubuntu 18.04.3.
(uncompressed)
(compressed)
Works a charm.
ADMINACCT = your admin login account name
PASSWORD = your admin password
MYDOMAIN = domain where database operates
Here's the output.
This is with Ubuntu 18.04.3.
(uncompressed)
mysqldump --opt --default-character-set=utf8mb4 -u'ADMINACCT' -p'PASSWORD' xenforo > /var/www/html/MYDOMAIN/mysql_backups/xenforo-backup-$(date +\%F).sql
(compressed)
mysqldump --opt --default-character-set=utf8mb4 -u'ADMINACCT' -p'PASSWORD' xenforo | gzip -c > /var/www/html/MYDOMAIN/mysql_backups/xenforo-backup-$(date +\%F).sql.gz
Works a charm.
ADMINACCT = your admin login account name
PASSWORD = your admin password
MYDOMAIN = domain where database operates
Here's the output.