Finally: Full Google-Calendar Sync with GCALDaemon
Since I use Google Calendar I was looking for an elegant and logical solution to keep it synchronized with my local calendar application (which was to be found) – biderectional. I guess soon this will become a standard feature, however by now it is not. Today I stumbled upon what I was looking for, and once again this is possible due to the *nix-Core of OSX.
Update: Flawless Sync with CalDav
Sync without any tweaking around is working perfectly with Google’s CalDav. Check out how to set it up here and enjoy flawless syncronization.
Big thanks go out to an anonymous commenter!
Update for OSX 10.5 Leopard
As things are by now it seems that Leopard stores iCal’s files kind of unusual and without extra PERL-Scripts and other humpty-tumpty hacking there’s no way of getting GCALDaemon to properly work with it. Therefore this solution is plain not working and not recommended for Leopard. I’ve hear that Plaxo Online can do all the syncing, but haven’t tried myself.
But don’t mind that, in clear words what this solution does is: Whatever calendar program you’re using, as long as it is based on .ical-files this handy little tool will run in the background and then, every few minutes, will synchronize this file with your google calendar. That way it’s totally independent from the calendar application and basically you can use whatever program suits your needs. You install this tool only once and then, forever, can sync any local ical file with any online google calender – bidirectional. The following instructions are for setting the thing up with Apple’s iCal, but other programs are pretty much the same.
GCALDaemon
A great and simple program, doing one thing: It synchronizes your remote google calendar with your local .ical-sourcefile, and vice versa. That’s not just great because it simply works, it also brings along two major features: The local calendar file will keep the calendar 100% available offline plus it’s no problem switching to any other program that’s using the ical – format.
However since we’re talking about an unix-application here the installation requires a little Terminal-fiddling, but not as much as one would expect. The following tutorial will make you a happy synchronized person and I promise things are easy, because I’ll use the finder instead of the terminal as much as possible. Now for the process:
- Download GCALDaemon
- Unzip to the correct directory
- Create your calendars
- Configure with the built-in GUI
- Install as startup-application
1: Downloading GCALDaemon
That one’s easy. Click the headline. Download the Linux/Mac – compatible .zip-archive. That’s it. don’t bother with the installation instructions, we’ll get that done in a second
2. Unzip to the correct directory
Unzip the archive to your desktop. In the now new directory you’ll find another directory: GCALDaemon. We’ll need this in a second. Now, first time for some Finder trickery. Click on an empty place on your desktop so the finder is the active application. Now either press Command + Shift + G or go to the menu bar and select “Go To > Folder …”. A dialogue box will pop up. Enter, and enter exactly:
-
/usr/local
If everything’s right you now should have a Finder window showing the folders: /lib and /sbin. If the latter doesn’t exist, create it now from within the Finder. You’ll probably have to identify as administrator, as those directories can be write-protected. That’s ok, enter your password, create the folder and get in. Congratulations, you’re now in /usr/local/sbin. On with the stuff.
Copy the folder GCALDaemon from your desktop to /usr/local/sbin. Once again it’s possible the system will ask you to identify – do that (do that whenever it happens during the installation process).
3. Create your calendars
If you haven’t already done that, go to iCal now and create your calendars as normal local calendars. If you just wanna try this you can also use the default calendar that’s already set up, repeating step 4 you can easily add more calendars whenever you feel like.
4. Configure with the built-in GUI
This one was listed at the end of the manual installation instructions and I kind of hated the GCALDaemon-Guys for a few minutes there. But you don’t have to suffer, but can profit from my findings. Now for the first of two terminal commands (you’ll need no more than those two, I promise). Open a Terminal window (Applications > Utilities > Terminal). Now type, and once again type exactly, the following:
-
/usr/local/sbin/GCALDaemon/bin/config-editor.sh
Execute the command by hitting the Enter. After a second or so a window will pop up. Ignore the whole settings-stuff and go to “File synchronizer”. Click the first line: “Enable file-based calendar synchronizer” until it’s checked green. Do the same with “Enable dial-up connection and/or use PDA synchronizer ['offline-enabled' mode]” (the latter is theoretically unnecessary when you’re on a constantly connected workstation, but the sync-mode is more flexible and there’s no disadvantages whatsoever, so just check if if you don’t have a good reason not to). The “Google Calendar polling interval” is the interval GCALDaemon uses to synchronize your online-calendar. The 15 minutes setting should be fine, so if you’re not excessively switching between browser and iCal access you can leave this alone.
Now for the real part. On the bottom right there’s a button “Google Accounts”. Click it, choose New Account, enter your mail and enter your password twice. Check with verify. If everything’s fine click ok. The next interesting button is the “New”-Button, just three steps left from the “Google Accounts”-one. Click it, select the remote calendar you want to synchronize and the local Calendar you want it to be synchronized with. Close the application and if you’re asked to save your changes click “Ok”. Tada, Magic done. You can repeat this step whenever you need to add or edit a calendar.
5. Install as startup-application – THANK YOU BUILD CHIMP
This is a little bit tricky, but if you follow the steps below you should be fine. Credits for that all go to Build Chimp. Now we need to tell OS X to execute this file on startup. This is being done with a .plist file. Open the editor (Applications > Utilities > Editor). Don’t use TextEdit, you’ll need the Editor! Create a new file, copy the following code – exactly – to the editor:
-
-
JAVA_HOME
-
/System/Frameworks/JavaVM.framework/Versions/1.5
-
-
Label
-
net.sf.gcald
-
OnDemand
-
-
ProgramArguments
-
-
/usr/local/sbin/GCALDaemon/bin/standalone-start.sh
-
-
RunAtLoad
-
-
ServiceDescription
-
GCALDaemon
-
StandardErrorPath
-
/usr/local/sbin/GCALDaemon/log/launchd.stderr
-
StandardOutPath
-
/usr/local/sbin/GCALDaemon/log/launchd.stdout
Easy. Now save the file to your desktop with the name:
net.sf.gcald.plist
Watch out that editor doesn’t add a file extension. Next we’ll have to move it to it’s final destination:
/Library/LaunchDaemons
Go to your desktop, double-click your harddrive (“Macintosh HD”, or “OSX”, or whatever yours is called). Select the folder “Library”, then select “LaunchDaemons”. There’s a good chance the folder is empty, but never mind, that’s ok. Now move the file net.sf.gcald.plist from the desktop to this folder (Indentification might be needed once more). We’re almost done.
Finally open a Terminal window again and type in the following line:
-
sudo launchctl load -w /Library/LaunchDaemons/net.sf.gcald.plist
Hit Enter. You’ll be asked for your password. As you enter it the Terminal will not reflect your input, no stars, no nothing, that’s normal. Just enter your password and finish with Enter.
Congratulations, you successfully installed full iCal / Google-Calendar synchronization.
If you’re fine with the terminal you could now start the tool manually with the line
-
/usr/local/sbin/GCALDaemon/bin/standalone-start.sh
or initialize a first sync with
-
/usr/local/sbin/GCALDaemon/bin/sync-now.sh
Otherwise you’ll have to logout and back in. Remember that the synchronization-interval is 15 minutes and the data transfer might take some time, but for me it by now works perfectly fine and I really enjoy the synced calendaring.
You beauty – this worked great – i even taught myself how to use terminal!!! Is their a way I can make a button to run the synchronise now sh script
Hi Peter. Welcome to the sync’d club ^^ you can easily create an applescript that executes the shell command, save this applescript as a standalone application and then add it to your dock. Voila – 1 click and you’re synced.
Procedure:
Open Applications/AppleScript/Scripteditor
Write: do shell script “/usr/local/sbin/GCALDaemon/bin/sync-now.sh”
Save as Application and check the “run only”-box.
I can’t install GCALDaemon.
How i check the java version 1.5 on my computer?
Open a terminal window and type
java -versionYou’ll get something like
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-241)The number behind “build” is the one that should be 1.5
Iv’e done all this – but created a new problem with osx. GCAL daemon wont let osx shut down. Every time you quit the GCAL daemon (or force quit) it reloads in a matter of seconds making a normal shutdown impossible.
Any ideas???
Hi Peter. Now that one sounds really weird and to be honest I don’t have a clue what’s going on there. I guess you already had a look at the activity monitor (Apps – Utilities) to see what’s running?
You could also try to kill GCALDaemon from within terminal. To find out it’s id use
ps -A | grep "GCAL"I’m getting three processes with that: The Daemon itself (with the path to /usr/local/sbin/), java and the ps-command itself. Have you got more? Or less?
To force kill a process use it’s id:
kill 123But that doesn’t solve your problem. I’d suggest contacting the GCALDaemon-guys, probably they know more about that?
I have exactly the same processes running. However if I attempt to Kill either java or org.gcaldaemon.standalone.Main using their id number, it tells me the following
peter-jeans-computer:~ peter$ kill 30
-bash: kill: (30) – Operation not permitted
peter-jeans-computer:~ peter$ kill 55
-bash: kill: (55) – Operation not permitted
Hm looks like GCALDaemon is running as a system- or admin process, thus refusing you permission to quit it. It might help to override the ownership of all related files with the finder:
File – Information – Owner & Permissions, change all the GCALDaemon files to being owned by the user peter, don’t forget the .plist-file.
You can verify if it’s a permission problem if you try to kill the process using superuser-rights:
sudo kill 1234Super user does kill the processes. I have rights to all the processes. However I notice that the gcal loads before I log in on startup – you can see it on the top toolbar. It is then owned by root like other system processes. Should the file be located in a different library folder than library/launch daemons?
PS Thanx for the help I am new to unix and mac.
Hey Peter,
I just checked with my setup again. The processes are running as system-processes here as well, so that wasn’t the issue. Sorry, could’ve figured that out in the first place.
After all it looks like we’re running the exact same setup and I’m afraid I’m out of ideas here.
One last thing: What version of OSX are you running? It’s 10.4.11 here.
I am running the same.
Thanx anyway. I can now shutdown but I have to close the daemon manually. As shutdown doesn’t seem to like it.
Thanks very much for clearly articulating the set up procedure. I installed GCaldaemon on my desktop and my lap top! Now I have all my calendars perfectly synced! Really appreciate your help.
Great Instructions! Thanks! Works Well..
Couple of hints if there are problems.
1. You can turn off the HTTP server if only file sync is being used.
2. I had an error about Java permissions not allowing some event.txt file to be written in the GCALDaemon/bin/ directory. I did Get Info on the GCALDaemon and made sure I had permissions set correctly (RW) and also allowed it to be applied to enclosing directories. The error went away.
3. Running standalone start means Terminal has to stay open – quitting terminal will terminate the process and so the sync will not work.
4. If you try to copy the line to create an application (see comments above) – do shell script “/usr/local/sbin/GCALDaemon/bin/sync-now.sh” – make sure the quotes ” are typed in correctly – script editor may not accept the pasted ones.
Thanks Again!
AM
I think some of the Security Updates from Apple kills this. I now have this error:
FATAL | Fatal service error!
java.io.FileNotFoundException: /usr/local/sbin/GCALDaemon/bin/../work/todo/xxxx-xxxx-cdc9b29.ics (Permission denied)
It looks like another permissions error. I’ll try to reset the permissions again. Any help on fixing this permanently would be appreciated.
Yes, I had to change the permissions and it worked again! Any permanent solutions please?
Hm if there’s a permission-problem I’d guess the files are in a folder that’s by default not writeable by your primary user?
I never had to update any permission-settings after the thing was up and running – but probably that’s just me.
I’d suggest you try to locate your calendars at another location or update the general status of your user, or set the group of GCALDaemon / the calling script to admin (this might be a security risk – I don’t have much experience on those things).
Also I can only talk about 10.4, if you run Leopard already it might be a OS-specific problem.
Hi,
Thank you so much for this, i’ve tried several times to install this daemon thing in the past year, everytime to give up….
today, you’re my god :)
oh, by the way, at the end, when i was asked to put in “sudo launchctl load -w /Library/LaunchDaemons/net.sf.gcald.plist” it gave me an error because of some permission problem. i went to the file, open it’s information, unlocked the file by clicking on the lock and giving permission. it allowed me to go through the rest of the installation.
cheers!
Hello, has anybody made the daemon working with Leopard? My /usr/local folder has no bin and sbin subfolders and I also can’t create folders any other way than using terminal as the option is disabled in finder. I would just like to ask if the approach also works in Leopard, so I won’t break something. Thanks.
Hey guys,
This may seem like a really silly question but in step #5 you speak of a Editor in the Utilities folder. It seems like I don’t have it. I run Tiger by the way.
Your help will really be appreciated!
-Kumail
Use the free Smultron instead of mucking about with TextEdit… its much easier on the eye!
Also curious if anyone has this working on Leopard. I have been working on it for a day and have it working sporadically. It syncs sometimes iCal to Google. I have never gotten it to sync the other way. I get duplicates on all my all day events. I would like to get this to work, but I am about to throw in the towel.
I am running leapord and am having what Peter describes here. I can sync iCal to Google but not google to iCal. When trying to execute “sudo launchctl load -w /Library/LaunchDaemons/net.sf.gcald.plist” I get error “. I would LOVE to get this working to keep my wife and I in Sync! I have the google sync client for my Blackberry as well…would be great to get it working.
SORRY, here is the error “Dubious permissions on file (skipping): /Library/LaunchDaemons/net.sf.gcald.plist
“
After some research it seems that this solution, by now, is plain broken. No way getting it to work properly.
That’s sad but I guess we’ll have to deal with it :/
Hey!
Thank you so much for this explanation, that’s the first time I got GCALDaemon run… It also seems to work, the iCal -> gCal sync works fine (haven’t tested the gCal -> iCal sync yet, because my gCals were all empty and now I’m not at home so I can’ test it), but I have got one serious problem … now most of my events are doubled!!! Not the whole-day events, but the others .. they appear two times, once with the right time, and once 2 hours earlier … seems like GCALDaemon messes up with time zones or something like that … any ideas how to solve that?
Google Sync for Mac OS 10.5 Leopard
CalDAV released by Google.
http://www.google.com/support/calendar/bin/answer.py?answer=99357
With CalDAV support in Google Calendar, you’ll be able to view and edit your Google Calendar events directly in iCal. Any changes you make in iCal will automatically appear in Google Calendar the next time you sign in (and vice versa). If you use iCal while offline, changes you make will be saved and updated in Google Calendar when you get back online.
What is CalDAV
CalDAV is an open protocol that allows calendar access via WebDAV. CalDAV models calendar events as HTTP resources in iCalendar format, and models calendars containing events as WebDAV collections. This allows you to publish and subscribe to calendars, share them collaboratively, sync between multiple users and sync between multiple devices.
System requirements
Only iCal 3.x supports CalDAV sync. (iCal 3.x is standard in all versions of Leopard.)
Hello! I now it´s a little late to write here, but i followed the instructions, and could do everything, except the last step: when i write: “sudo launchctl load -w /Library/LaunchDaemons/net.sf.gcald.plist”
I get this message: “launchctl: opendir() failed to open the directory
nothing found to load”
I did the plist with Smultron as suggested, and i think that´s my problem… I´d be grateful to receive some help. By the way, i use tiger. Thanks in advance. Great explanations!
marcodovis@gmail.com
Thanks for posting this, but I ran into trouble trying your idea with Tiger. After successfully installing GALDaemon in /usr/local/sbin, I entered
/usr/local/sbin/GCALDaemon/bin/config-editor.sh
and got the response
tcsh: pre: No such file or directory.
I really don’t know any UNIX so I don’t understand what to do. Please help! Thanks.
I recommend not using GCalDaemon guide and using CalDav as described in the update in this post.
As I understand it, CalDav requires Leopard. With my oldish Mac, I’m better off staying with Tiger. I hope it’s possible to use GcalDaemon in that case.
Good point!
The response means that the file isn’t where it should be. I guess there’s something wrong with the path of your installation.
Try going to “/usr/local/sbin” via the “Go To > Folder …” command in Finder and check if the directory “GCALDaemon” is there. Then open it and follow the path to /bin. Look for the “config-editor.sh” file there.
If the path is correct and it still isn’t working there could be something wrong with the installation. I’d suggest you delete the whole GCALDaemon directory and re-install it.
Also, it comes to mind that GCALDaemon requires Java 1.5 – you might want to check your current version in Terminal: “java -version”. If it’s less than 1.5 you need to upgrade.
Finally make sure you downloaded the correct GCALDaemon ZIP file (you needs the Unix/Linux/ … compatible one).
Thanks for your help! That worked except that I got an error saying there was no plist file, even though I created it (with TextWrangler – I have no Applications > Editor, and the file extension is .plist).
I used my existing ical calendars and created blank Google calendars. However when I synced manually I got error messages saying it couldn’t move repeating events into Google. There are threads about this on the web, but I haven’t figured out if the problem has been solved. Do you know anything about this?
Hm no. As far as I remember repeating events used to work just fine, but it’s been a while since I used GCALDaemon :)