# Sync / Share Google Calendar & Nextcloud Calendar

**URL:** <https://help.nextcloud.com/t/sync-share-google-calendar-nextcloud-calendar/114131>\
**Category:** ℹ️ Support\
**Tags:** calendar-app\
**Created:** [April 18, 2021, 8:38pm UTC](https://help.nextcloud.com/t/sync-share-google-calendar-nextcloud-calendar/114131 "2021-04-18T20:38:11Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![rodinux](https://help.nextcloud.com/user_avatar/help.nextcloud.com/rodinux/32/44316_2.png) [@rodinux](https://help.nextcloud.com/u/rodinux)\
**Post date:** [June 30, 2022, 2:57pm UTC](https://help.nextcloud.com/t/sync-share-google-calendar-nextcloud-calendar/114131/9 "2022-06-30T14:57:53Z")

</div>

I just add this hack to do if you sync a google calendar on your Nextcloud Calendar.

The refresh rate of a calendar subscription in Nextcloud is once every week by default.

[https://docs.nextcloud.com/server/19/user\_manual/pim/calendar.html](https://docs.nextcloud.com/server/19/user_manual/pim/calendar.html)

> Subscriptions are refreshed every week by default. Your admin may have changed this setting.

Change the refresh rate:

- Connect with a terminal in ‘root’ to the Nextcloud instance.
- Position yourself at the root of the Nextcloud site.  
`cd /var/www/nextcloud.example.com/www/ # For example`
- Get the owner of the ‘config.php’ file.

```auto
ls -l config/config.php
.rw-r----- nextcloud nextcloud 1.5 KB Wed May 25 10:17:35 2022 config/config.php

```

- Change the value of the ‘calendarSubscriptionRefreshRate’ option of the Nextcloud calendar app to 5 minutes.

```auto
sudo -u nextcloud php8.0 occ config:app:set dav calendarSubscriptionRefreshRate --value "PT5M"
# Résultat :
# Config value calendarSubscriptionRefreshRate for app dav set to PT5M

```

- Use the user who owns the config file.php with the sudo command. Use the php binary corresponding to the Nextcloud version.
- Check the consideration.

```auto
sudo -u nextcloud php8.0 occ config:list | grep -i calendar
# Résultat :
# "calendar": {
# "calendarSubscriptionRefreshRate": "PT5M",

```

## Crontab

- Edit the crontab of the user who owns the config file.php seen above.

```auto
sudo -u nextcloud crontab -e

```

- Add a task every 5 minutes running the php script located at the root of the Nextcloud site.

```auto
*/5 * * * * php8.0 -f /var/www/nextcloud.example.com/www/cron.php

```

- Use the php binary corresponding to the Nextcloud version.
- Log in as ‘admin’ on the Nextcloud web interface. Then go to **Settings**.
- In the **Administration** section at the bottom left, go to **Basic Settings**.
- Ensure that **Background Tasks** are configured with ‘Cron’.  
 ![469843cdec6eff1063dff5d85c2f4f1be470e429_2_690x173](https://help.nextcloud.com/uploads/default/original/3X/6/2/628ac7608378cc5963ed27144629b710817e4808.png)

## Sources

[https://www.aukfood.fr/nextcloud-ajouter-un-calendrier-google-prive-sans-credentials/](https://www.aukfood.fr/nextcloud-ajouter-un-calendrier-google-prive-sans-credentials/)  
[Using the Calendar app — Nextcloud latest User Manual latest documentation](https://docs.nextcloud.com/server/19/user_manual/pim/calendar.html)  
[Calendar / CalDAV — Nextcloud latest Administration Manual latest documentation](https://docs.nextcloud.com/server/latest/admin_manual/groupware/calendar.html#refresh-rate)  
[PHP: DateInterval::\_\_construct - Manual](https://www.php.net/manual/fr/dateinterval.construct.php)

---

_[View the full topic](https://help.nextcloud.com/t/sync-share-google-calendar-nextcloud-calendar/114131)._
