Continously syncrhonize calendars in background using jobs
Importing Google calendars once is great when migrating from Google to Nextcloud, but in my situation, I have to continue using Google calendar for work, and I want that to be synchronized to my Nextcloud. Based on the reactions and comments in #77, it seems that other people are interested in this as well.
The changes made are:
- Before importing all the events from a calendar, first all the existing events are deleted. That way, if events are deleted (or replaced with an event in a new time slot) in Google calendar, they will not stick around in Nextcloud
- Added a background job
ImportCalendarJob.php. Added a button beside "Synchronize calendar" called "Sync calendar" that will register this background job for a calendar.
It seems that this repository is for migrating from Google, not keeping Google stuff synced to Nextcloud, so maybe you are not interested in these changes. That said, going by the thumbs up and feedback in #77, it seems a lot of users want this.
I know that there are probably a lot of changes that need to be made before this can be merged. For instance, there should be some guard against setting up a background job for the same calendar twice. Furthermore, the sync status of a calendar should be brought into the front end. Please let me know what changes are required and I can work on them.
I think this is a great addition to make. "Integration" makes it confusing if it really only refers to "importing". I also need to keep using a Google Calendar for work and would much rather do it through NC to see all my calendars at once, instead of the other way round—which would make all my data available to G (precisely what I'm trying to avoid).
I just updated my additions to properly track what needs to be deleted instead of deleting everything and re-importing everything. This brings one of my >1000 event calendars from a 162 second import to a 4 second import.
Ping @eneiluj, you were the last one to release a new version for this plugin. What is the follow up here?
Any news on this? It would save so much time. Thanks
There have been many requests in the past of Nextcloud being capable of syncing with other CalDAV servers. Google offers CalDav as an interface as far as I know - so maybe a separate, more generic app that would allow to keep a local copy of a remote CalDAV calendar in sync would be an option an make many people happy?
Hi and sorry for the late answer. This app's purpose is not to sync things but to import them to facilitate an account migration. @MarcelRobitaille I'm sorry you spent time implementing this and it won't be merged. You can perfectly publish a fork of this app if you want to push in the "sync" direction. It might be something interesting for many people. It's just not the way I want it to go.
A middle ground would be to implement an occ command to import a calendar so that the "sync" could be set externally with a system cron task running the occ command.
The command could accept those parameters: a user ID, a remote calendar ID (or name) and a local calendar ID/name. What do you think?
I don't have much time to spend on this but would be ready to review and merge a PR implementing this.
@julien-nc Thanks for your answer. I think I will publish a fork then.
Hello, is this fork updated with the latest version? I want to use it
@Buronn My fork has the latest version, yes. But I haven't published it as a separate Nextcloud app that is easy to install. I will try to do that soon.
@Buronn My fork has the latest version, yes. But I haven't published it as a separate Nextcloud app that is easy to install. I will try to do that soon.
Nice, I would like to have it.
I've rebased onto the latest changes to this app. I changed the name of my fork so I can publish it as its own app. I'm just waiting for my certificate request to be approved.
@julien-nc Do you think it would be possible to update the README of this app to make it clear that it only supports manual synchronization? It would be great if you could add something like "if you need automatic continuous synchronization, you could try https://github.com/MarcelRobitaille/nextcloud_google_synchronization" too :slightly_smiling_face:
The fork is live! https://apps.nextcloud.com/apps/google_synchronization. Please note it is not well-tested. I would be happy to receive your feedback.
As stated previously by @julien-nc "This app's purpose is not to sync things but to import them to facilitate an account migration." I'm thus closing this.