Hey I am new here and also new to the whole Docker universe in general, so I just want to apologize first of all for this unsophisticated post.
I did a fresh nextcloud install in my OMV via the GUI with MariaDB and LetsEncrypt. Everything works just fine but I was asking myself how to do automated backups of my data and the whole installation in a sufficient way. I connected a second external drive to my server tried to follow the steps discribed in the nextcloud documentation- unfortunately i was not able to write a working script to backup everything.
Here are the bash commands I tried to use:
docker exec -it nextcloud bash
sudo -u abc php /config/www/nextcloud/occ maintenance:mode --on
exit
tar -cpzf /sharedfolders/Next_Backup/nextcloud_files_$now.tar.gz /sharedfolders/Nextcloud-Data/
docker exec mariadb sh -c exec mysqldump --single-transaction -h localhost -u 1000 -p100 nextcloud > /sharedfolders/Next_Backup/nextcloudDB_1.sql
docker exec -it nextcloud bash
sudo -u abc php /config/www/nextcloud/occ maintenance:mode --off
i was able to create backupfiles of the Data and the Database… but I want to automate the process… is this possible? And How? Or is there a better way?
Thank you very much!