You find many different possibilities how to do a MariaDB/MySQL backup with mariadb-dump/mysqldump. But which one is the correct one?
Correct mariadb-dump/mysqldump backup
Correct is a question of definition… I suggest starting with the following command for a full backup:
For my.cnf
$ BACKUP_TIMESTAMP=`date '+%Y-%m-%d_%H-%M-%S'`
$ BACKUP_DIR='/mybackupdir'
$ cp /etc/my.cnf $BACKUP_DIR/my_$BACKUP_TIMESTAMP.cnf
For MariaDB/MySQL databases with MyISAM or Aria tables
$ …