I like to backup my Nextcloud calendars and addressbooks as .ics/.vcf files, because it is very easy to restore: just import the backed up .ics/.vcf file to the server or a client and the accidentally deleted data is back online.
Therefore I initially wrote a bash script with hardcoded links for my nextcloud installation. Two friends were interested and so I improved the script to be more generic which possibly makes it interesting for other users as well.
The script downloads all available calendars/addressbooks belonging to certain users from a Nextcloud instance as .ics/.vcf files. Usernames and according passwords have to be given in a separate file. All downloaded files are then compressed to a single file with the current date in the filename.
It works with all currently released Nextcloud versions (and ownCloud >= 5.0) and has been tested under Debian Wheezy, Jessie and Stretch. Of course shell access to the server is needed. Configuration is quite simple: in most cases the path to the Nextcloud directory sufficient. It is not necessary to run the script with root privileges - in default configuration it only needs to have read access to Nextclouds configuration file ‘config.php’. At no point any data leaves the server.
If that sounds interesting to you, you are welcome to use it: