Backing up WordPress Database from Command Line – Tareq Hasan
As a developer who is very sensitive about performance, I never (mostly) used any backup plugin those depends mostly upon WordPress cron and tries to backup and upload to the same server or a remote server without offloading from the main PHP process. To me, it feels like I’m slowing down the server by relying on backing up a site on PHP FPM. It could be done more efficiently from command line using tools like mysqldump, gzipping it and copying to any location you would like. Because it’s supposed to work like that, I never liked any backup plugin (I can’t speak for every backup solutions out there, but most plugin does). Although VaultPress bridges the gap between both of two worlds by backing up normally and using SSH, but it’s costly. Well, not that much, but still you require to opt-in to their monthly payment plan.
Till now I’ve been using bash scripts to backup my sites, but those also require you to manually edit and put the server locations where to store the backup and they aren’t all purpose scripts. So I built a new one – wp-db-backup. It’s just like another command line utility that lets you do whatever you want without touching
Source: https://managewp.org/articles/17974/backing-up-wordpress-database-from-command-line-tareq-hasan
source https://williechiu40.wordpress.com/2018/10/15/backing-up-wordpress-database-from-command-line-tareq-hasan/