this is similar to following post https://dietpi.com/forum/t/backup-dietpi-userdata-which-has-been-moved-to-external-drive/4802/1
You would need to create your own rsync script to backup data on an external drive. As well I would recommend to have a look to NextCloud docs to check how to backup your database as well. https://docs.nextcloud.com/server/latest/admin_manual/maintenance/backup.html#
A little bit of some discussion around backups https://dietpi.com/forum/t/automate-dietpi-backup/2271/24