Hello there,
I just downloaded GCALDaemon and it works like a charm on leopard.
iCal in leopard stores each event in its own .ics file - and in a new location - but apparently GCALDaemon has no problems with wildcards!
This is what I entered in gcal-daemon.cfg:
file.ical.path=/Users/bek/Library/Calendars/5A55BA6F-651C-42CB-8176-757CBBF72211.calendar/Events/*.ics
Try this (replacing username and calendar directory) and you're all set!
Sincerely,
/morten
Did you have to change anything else? I see the google .ics files coming into the /Events/ directory, but nothing is showing up in iCal.
This is what I entered in gcal-daemon.cfg:
file.ical.path=/Users/bek/Library/Calendars/5A55BA6F-651C-42CB-8176-757CBBF72211.calendar/Events/*.ics
#!/usr/bin/perl
# Sean Sabbage 2008
# This script takes the individual events in iCal for Leopard and puts them
# in to a single corestorage.ics file in ~/Library/Calendars/*.calendar/
# for each individual calendar.
# RUN BEFORE coreimport.pl
# Don't run when iCal is running. I haven't tested this, but it's likely to break something.
# Won't work on anything before Leopard (10.5)
# It only copies across VTODOs and VEVENTS. I haven't come across anything else, yet.
# Free to use and work with as you will
use strict;
use warnings;
my $home = ""; # Put the link to your home directory here. Likely to be /Users/<username>
my @paths = <$home/Library/Calendars/*.calendar>;
foreach(@paths){
open (CORE, ">$_/corestorage.ics");
print CORE "BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//Apple Inc.//iCal 3.0//EN\nCALSCALE:GREGORIAN\n";
my @files = <$_/Events/*.ics>;
foreach(@files){
open (ICS, "<$_");
my $bEvent = 0;
while(<ICS>){
$_ =~ s/\r//;
if ($_ =~ m/(BEGIN:VEVENT|BEGIN:VTODO)/){
$bEvent=1;
print CORE $_;
} elsif ($_ =~ m/(END:VEVENT|END:VTODO)/){
$bEvent=0;
print CORE $_;
} elsif ($bEvent==1){
print CORE $_;
}
}
close(ICS);
}
print CORE "END:VCALENDAR";
close (CORE);
}
#!/usr/bin/perl
# Sean Sabbage 2008
# This script breaks the home made corestorage.ics up into individual
# events and puts them in the necessary folders so iCal can read them. It
# deletes all events before it does that, and the Calendar Cache, to make
# sure that iCal updates.
# Back up iCal BEFORE use, I am not responsible if you lose all your calendars.
# RUN AFTER coreimport.pl
# Don't run when iCal is running. I haven't tested this, but it's likely to break something.
# Won't work on anything before Leopard (10.5)
# It only copies across VTODOs and VEVENTS. I haven't come across anything else, yet.
# Free to use and work with as you will
use strict;
use warnings;
my $home = ""; # Put the link to your home directory here. Likely to be /Users/<username>
my @paths = <$home/Library/Calendars/*.calendar>;
unlink("$home/Library/Calendars/Calendar Cache");
foreach (@paths){
my $path = $_;
open (CORE, "<$_/corestorage.ics");
my $header = "BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//Apple Inc.//iCal 3.0//EN\nCALSCALE:GREGORIAN\n";
my $footer = "END:VCALENDAR";
my @events = <$path/Events/*.ics>;
foreach(@events){
unlink($_);
}
my $lines;
my $uid;
while(<CORE>){
$lines = $lines . $_;
if($_ =~ m/(BEGIN:VEVENT|BEGIN:VTODO)/){
$lines = $_;
} elsif($_ =~ m/UID:(.+)/){
$uid = "$1";
$uid =~ s/\r//g;
} elsif($_ =~ m/(END:VEVENT|END:VTODO)/){
open (CAL, ">$path/Events/$uid.ics");
print CAL $header;
$lines =~ s/\r//g;
print CAL $lines;
print CAL $footer;
close(CAL);
}
}
close (CORE);
}
#!/bin/sh
#
# Run coreimport.pl
# Run GCALDaemon once
# Run coreexport.pl
path="/Users/***/GCALDaemon/bin"
$path/coreimport.pl
sh $path/sync-now.sh
$path/coreexport.pl
Oops, just caught a small code bug in coreexport.pl which meant iCal wasn't deleting items that had been added by google. Fixed now.
I'm afraid it is not!
Only changes in iCal are stored. Even if I change an Event within Google it is RESET to the original date/time, as soon as I sync!
Do you have a bugfix for that?
I'm afraid it is not!
Only changes in iCal are stored. Even if I change an Event within Google it is RESET to the original date/time, as soon as I sync!
Do you have a bugfix for that?
Fixed now, one that slipped through my unextensive testing. Use the updated coreexport.pl above.
Hi,
I have a bad news. I don't know if this problem is caused by GCALDaemon itself or your Script.
The Sync goes well - firstly.
At the time I sync, iCal is closed! I open it, and all Events are synced well. Events, that were deleted in Google Calendar have gone, the others are updated. Both Calendars seem to be up to date.
I close iCal and open it again after 1 or 2 seconds. And - the deleted Events are again there. After the next sync, they also appear in Google Calendar again!
The Calendar Cache ist definitley flushed when syncing AND the .ics-Files in the Events-Dir are also unlinked. Nevertheless after the restart of iCal they appear again - there must exist another calendar-Cache, but where? Any idea?
This worked for me without the perl script, but I also had to make a few permissions changes. I noticed when I ran the sync-now.sh script in the terminal that there were several errors regarding permissions. What I had to do was assign recursive read/write permissions for my username to /Users/username/Library/Calendars. Before doing this, GCalDaemon was unable to read/write to the *.ics files in these directories.I just messed with the conf file and it syncs both ways for me on Lepoard!
I do need to restart iCal after syncing, though, and I have not tried the daemon.
Just comment out ('#') the the blank config line in conf/gcal-daemon.cfg that the sync is barfing on- your other calendars have a number at the end of them- something like this (I left the context in there so you can find it in the conf file :
################################################
# CONFIGURATION OF THE FILE-BASED SYNCHRONIZER #
################################################
# Enable built-in HTTP server/synchronizer
file.enabled=true
# Full path of the local iCalendar file (don't include backslash characters!)
#file.ical.path=/google1.ics
# URL (without hostname) of the Google Calendar's private ical file
#file.private.ical.url=
# Full path of the local iCalendar file (don't include backslash characters!)
file.ical.path2=/Users/me/Library/Calendars/4F6110FF-11C1-40C6-9610-C3F2A1E45E1C.calendar/Events/*.ics
# URL (without hostname) of the Google Calendar's private ical file
file.private.ical.url2=/calendar/ical/dfg8l45eec77bif0oatl9f3g88%40group.calendar.google.com/private/basic.ics
# Gmail user (your full email address)
file.google.username2=me@gmail.com
Hope that works for you too!
Originally Posted by rideallday
I just messed with the conf file and it syncs both ways for me on Lepoard!
I do need to restart iCal after syncing, though, and I have not tried the daemon.
Just comment out ('#') the the blank config line in conf/gcal-daemon.cfg that the sync is barfing on- your other calendars have a number at the end of them- something like this (I left the context in there so you can find it in the conf file :
################################################
# CONFIGURATION OF THE FILE-BASED SYNCHRONIZER #
################################################
# Enable built-in HTTP server/synchronizer
file.enabled=true
# Full path of the local iCalendar file (don't include backslash characters!)
#file.ical.path=/google1.ics
# URL (without hostname) of the Google Calendar's private ical file
#file.private.ical.url=
# Full path of the local iCalendar file (don't include backslash characters!)
file.ical.path2=/Users/me/Library/Calendars/4F6110FF-11C1-40C6-9610-C3F2A1E45E1C.calendar/Events/*.ics
# URL (without hostname) of the Google Calendar's private ical file
file.private.ical.url2=/calendar/ical/dfg8l45eec77bif0oatl9f3g88%40group.calendar.google.com/private/basic.ics
# Gmail user (your full email address)
file.google.username2=me@gmail.com
Hope that works for you too!