A SQL dump of a big database is slow to make and slower to restore, because every row gets inserted again. mariadb-backup copies the data files themselves while the server keeps running.
mariadb-backup --backup --target-dir=/backup/full --user=root --password
mariadb-backup --prepare --target-dir=/backup/full
The first step copies the files and records the changes that came in during the copy. Right after it, the files are not consistent yet. The --prepare step applies that log, and only then is the directory a clean copy that a server can start from. Both runs end with completed OK! when things went well, and I’d check for that line in any script.
To restore, stop the server, make sure the data directory is empty, copy the files back and fix the owner:
mariadb-backup --copy-back --target-dir=/backup/full
chown -R mysql:mysql /var/lib/mysql
A few things trip people up. The backup only fits the same major MariaDB version, so it is not a way to move data between versions; use a dump for that. --copy-back refuses to write into a data directory that still has files, and that is a good thing, because it protects whatever is there. In Docker, run it inside the MariaDB container so the tool and the server versions match.
Further reading: Full backup and restore with mariadb-backup