Take a look at https://smarthome-kompendium.com - the best place to get informed!
Create a backup of the raspberry pi on a NAS using cronjobs
This script was created by raspberry.tips (https://raspberry.tips/raspberrypi-einsteiger/raspberry-pi-datensicherung-erstellen). Modified by Lukas Knoeller to send mails.
More information available here: https://hobbyblogging.de/raspberry-pi-vollautomatisch-sichern (german)
Please keep in mind that removing your sd-cart from the Pi is a much better solution to create an image of it. There are many tools to create an image from an sd-card.