How to implement enfantme's "Nextcloud-Google-Calendar-Sync" script

How to implement enfantme’s “Nextcloud-Google-Calendar-Sync” script

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • RaspPi 4b; NextcloudPi v1.55.3; Nextcloud v30.0.1.2
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No (I don’t know what this is)

Summary of the issue you are facing:

TL/DR:
From PuTTY on Windows 10, how do I copy over to my headless NextcloudPi server, run, and ultimately create a CRON job for the “NextCloud-Google Calendar Sync” python script found HERE? I have already generated the required “credentials.json” file. Oh, if there’s a better way achieve a 2-way sync from Google Calendar <> NextCloud, I’m all ears!

The Setup:
I am very new to NextCloud and have only a basic understanding of Linux but am a fairly advanced “power user” of Windows. I successfully installed NextcloudPi on a Raspberry Pi 4b and is serving two users and their android phones via web interface (Firefox), the official NextCloud app (phone: file access) and DAVx app (phone: contacts & NextCloud calendars). The phones are using Fossify’s open-source “Calendar” app to interact with the calendars provided via DAVx.

The Issue:
The issue I have is I need to setup a stable 2-way calendar sync to/from a Google account. Unfortunately, this Google calendar is tied to employment and cannot be migrated and abandoned. I need this Work calendar to seamlessly integrate into the NextCloud ecosystem so that both users and their phones can see and interact with the calendar as though it was just another NextCloud calendar (I know how to share NextCloud calendars between users).

Solutions I’ve Tried:
I have searched the help forums and tried the many recommendations including those in THIS POST. Additionally, I have successfully installed and setup the “Google Integration” NextCloud app as well as the “Google Synchronization” app (not at the same time of course). Both apps worked as intended, mostly. The “Integration” app is actually just for migrating Google data into NextCloud and doesn’t support continuous 2-way syncing. The “Synchronization” app will migrate and maintain a 1-way sync to NextCloud however the sync seems to only update once a week (?) and the account authorization expires weekly without any warnings at the phones or user’s web portal. This authorization must be manually reset every week via the NextCloud web portal making this app un-usable.

Importing Google “ical” subscriptions are not a solution since they are also only 1-way and the sync rate seems to be very poor.

The Question:
All this has lead me to GitHub where I found THIS PROJECT which claims a stable, 2-way sync of Google Calendar <> NextCloud. Using Windows 10, I have downloaded the python script and followed the instructions to generate a “credentials.json” file from the desired Google Account. As stated in the TL/DR above, what are the steps I must follow to copy over the script and json file to my headless NextCloudPi server, initiate the script and then create a CRON job to continually invoke the script for regular calendar syncs (say once a minute)? On my Windows computer I have PuTTY setup to access the Raspberry Pi over SSH.

Thank you all for your time.