I use a combinations of Tar (Tape Archive) and WP-Cli (WordPress Command Line Interface)
#!/usr/bin/env bash D=$(date +'%Y%m%d%H%M%S') P="/var/www" S="bleppe.se" echo "Dumping database to: ${P}/${S}-${D}.sql" cd ${P}/${S} wp --allow-root db export ${P}/${S}-${D}.sql echo "Backing up with tar: ${P}/${S}-${D}.tgz" cd ${P} tar --exclude=${S}/wp-content/uploads -zcf ${S}-${D}.tgz ${S}/