# Calcardbackup: bash script to backup Nextcloud calendars and addressbooks as \*.ics/\*.vcf files

**URL:** <https://help.nextcloud.com/t/calcardbackup-bash-script-to-backup-nextcloud-calendars-and-addressbooks-as-ics-vcf-files/11978>\
**Category:** 📑 How to\
**Tags:** backup, contacts-app, ncp, calendar-app, deck-app\
**Created:** [April 30, 2017, 7:58am UTC](https://help.nextcloud.com/t/calcardbackup-bash-script-to-backup-nextcloud-calendars-and-addressbooks-as-ics-vcf-files/11978 "2017-04-30T07:58:24Z")\
**Posts on this page:** 1\
**Showing post:** 28

<div class="post-metadata">

**Author:** ![weka](https://help.nextcloud.com/letter_avatar/weka/32/5_5575768a8748004e209b776fc1b2916d.png) [@weka](https://help.nextcloud.com/u/weka)\
**Post date:** [February 5, 2020, 4:34pm UTC](https://help.nextcloud.com/t/calcardbackup-bash-script-to-backup-nextcloud-calendars-and-addressbooks-as-ics-vcf-files/11978/28 "2020-02-05T16:34:22Z")

</div>

Ok, I understand it now!

The misunderstanding was due to the combination of the option’s name and its explanation: the option is called “include-shares”, and the explanation says:

> Backup shared addressbooks/calendars, too.

That can lead to the impression that you if you use it, shared calendars will be saved.

Once you are under that impression, the next sentence, saying that

> Items will only be backed up once: e.g. a shared calendar won’t be backed up if the same calendar was already backed up for another user.

automatically sounds like “this will happen if you don’t use this option”.

I guess I would not have fallen for this misinterpretation, if those two sentences were linked by the word “but”:

> Backup shared addressbooks/calendars, too, **but** every item will only be saved once!

Something like this, maybe. 🙂

By the way…

In another thread I was asking about an add on that does what your script does, and that will be configurable via NextCloud’s GUI. The reason for this question is, that even an NC admin does not always have shell access to the server, so your script can not be used.

On the other hand I think it is very important to have a very fast and easy way of regaining the users calendars and contacts, if the server would crash or the data base would corrupt, while NC is still running. Letting the users access backups of their calendars as ical files, would be the fastest way to let them restore their calendars and contacts.

You script does exactly that: extracting the calendars and contacts, and copy the archives to the users file sharing area, where they can be downloaded. But if the admin can not ssh into the server, your script can not be used.

So, my question is: would it be very difficult to turn your script into an add on that the admin can configure in NC’s gui to provide this kind of function?

---

_[View the full topic](https://help.nextcloud.com/t/calcardbackup-bash-script-to-backup-nextcloud-calendars-and-addressbooks-as-ics-vcf-files/11978)._
