LuxCal Forum

The place for questions, suggestions and news about the LuxCal Event Calendar

User:   Password:   Remember Me?   
LuxCal Forum / General / Problems / Cron Jobs for exporting files
Posted:  12 Apr 2013 16:38
I am really a greenhorn in PHP, however, installing Luxcal ist easy and it works.
What I need, is a synchronization of the events to Outlook. This works over exporting to an .ics File an importing an Internet calendar in Outlook. So well, but is it possible to make a cron Job that exports the calendar to an .ics file twice a day? I have no access on the server (SSH), but is it possible using the files in the folder cronjob?
Thank you for ideas an help.

Posted:  15 Apr 2013 11:19   Last Edited By: Roel B.
Hi Uwe,
Currently, there is no script that could be started via a cron job to periodically export a .ics file with added/changed events.
In the past we've already considered to add this option, but it requires some special processing. For instance, to avoid exporting the same event every time again when the cron job runs, it has to be remembered which events already have been exported.
I will think about it again, but it's too late to add this to LuxCal v3.1.0, which we will release this month.
Posted:  16 Apr 2013 09:54
Hi Roel,
thank you for your quick answer. Would it be easier if there is no need to remember which events already have been exported? For us, it would be ok, if the complete calendar would be exported.

Posted:  16 Apr 2013 22:38   Last Edited By: Roel B.
Hi Uwe,
I'm still thinking about it wink
Maybe I will still add something to the new LuxCal 3.1.0 version. But I can't promise anything yet.

What I could do is use the current cron job mechanism, which runs once a day (twice a day would be more complicated) and produce a .ics file in the "files" folder with all calendar changes of the day before (yesterday). The calendar changes would include: added, edited and deleted events.
The file name could for instance be: changes-yyyymmdd.ics, where yyyymmdd is the date of the changes.
So maximum 365 files per year. (Who will eventually delete these files?)

What do you think of this?
Posted:  17 Apr 2013 11:04
Hello Roel,
good idea, but, if you use Outlook, you have to specify the correct link to the .ics file, like luxcalfilescalendar.ics. Then, Outlook can  automatically update the calendar if you use the function "update all folders" manually or automatically in the default settings of Outlook, e.g. every 15 minutes.

If you write every day a new filename like changes-yyymmdd.ics in your example, you must change the filename in Outlook every day. This is not easy to handle. And, I have no idea of an solution that Outlook can add changes to an existing calendar, if the exported file contains only the changes of the day.

Please look, I need an idiot-proof solution for my fellows. We are a very small charitable research institute an I`m the only one with a little bit know-how about computer, network and internet. The commercial solutions like "active-sync", offered from some internet provider are too expensive for us. The alternative for Linux, a zarafa groupware server with z-push overruns my responsibilities.

What is said against exporting the whole calendar with the same filename once a day? All changes would be included. Then we can update the Outlook calendar automatically once a day, synchronize these calendar with our mobile phones and on the road we can use the internet view of luxcal to look for changes.thump_up

Posted:  17 Apr 2013 21:36
Hello again Uwe,

Ok, so you would prefer to export all events and use each time the same file name (so overwriting the previous file).
This is also possible. As a file name I could for instance user the calendar title.
When exporting each time ALL events, is there not the risk in Outlook to get double events? I mean if events that have been imported yesterday are imported again today, and imported again tomorrow, etc. will Outlook detect that it concerns the same event?

Do you think that really all events should be exported, also all events which are in the past? For instance after two years you will still be exporting/importing 2-year old events. Or should LuxCal for instance export all events which are not older than one week?

Posted:  18 Apr 2013 17:01
Hi Roel,

yes, so it is, exporting all events, using each time the same filename and overwriting the previous file. Calendar title as filename is also OK.
There is no risk to get double events in outlook. I made a test: Filling up some events, exports the calendar, updated the outlook calendar. Then I added an event and changed an existing event in the luxcal calendar. Exporting again with the same filename and again updated the outlook calendar. All changes are correct in outlook, same items like in the luxcal calendar. Outlook can detect that.

For us it is nice to have a longer view back, because our Projects often run over two years or longer. And if you ask yourself about the date of the workshop last year you can look at the calendar.

But in an abstract view I think, if the test I wrote above work, your idea to export all events which are not older than one week must work too. I will test it.

Posted:  18 Apr 2013 23:15
Hi Uwe,
Ok, I will see what I can do.
(My current problem is that I'm working on a new LuxCal version, which is in a beta-test stage and I would prefer to add this feature to this new version. However, this new version is not 100% ready to be released.)

Posted:  22 Apr 2013 22:19
Hi Uwe,
I've implemented your request in the new LuxCal version 3.1.0, which is currently under test.
What I can offer at the moment is to send you a beta version of this new release, so that you can test and see if daily exporting events in iCal format works ok for you. But it is still a BETA version!
If you are interested, send me your email address via the Contact Us page and I will send a zip-file and some instructions.
If you find this too risky or have no time, then it would be better to wait for the official new release.
Posted:  02 May 2013 18:26
Hi Roel,
sorry for my late answer. I tested it again an it doesn't work if you export only the daily events. Outlook will delete all older events. So, I hope it is possible that you can change it to "export the whole calendar". Then Outlook can import the calendar perfect and everybody will be happy smile