This one-liner will backup your WordPress files and database into a directory name with today’s date.
mkdir -p ../backup/$(date +%Y-%m-%d) ; mysqldump $(grep DB_NAME wp-config.php | grep -v WP_CACHE_KEY_SALT | cut -d \' -f 4) | gzip > ../backup/$(date +%Y-%m-%d)/db.sql.gz ; rsync -ahv --exclude 'wp-content/backups' --exclude 'wp-content/cache' . ../backup/$(date +%Y-%m-%d)/