LuxCal Forum

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

User:   Password:   Remember Me?   
LuxCal Forum / General / Support / ICS event backup incomplete / partial : Only 154 of 195 events saved
Posted:  03 Nov 2015 19:11
When the ics event backup file is created in the LuxCal /files directory each night the file created only contains 154 events.  When the ics export is performed from the LuxCal web admin login manually all 195 events are exported.  Why is the ics export run during the nightly cron job only backing up 154 events instead of all 195 events? 

Any ideas?

Mark Saginaw, Michigan
Posted:  03 Nov 2015 22:30
Hi Mark,

I had to look this up in the /cronjobs/expical.php script and found the following:
When a cron job triggers the creation of the ics event file, the expical.php script  is exporting the events in the following date bracket: -7 days - +365 days. Events expired more that 7 days ago are assumed to have been picked up in the past and are considered of not much interest any more.
Limiting the events to be exported to a certain date bracket is necessary to avoid that (e.g. after several years) thousands of events are exported, of which the majority lie in the past and are of no interest any more.
Posted:  04 Nov 2015 06:00
We use our calendar not only for new events but for a diary. This change will enable us to backup that history, thanks. I reset the the date range in the script and got what I was after.

    //set event date range
//    $expIcalHist = 7; //-7 days (maybe an admin setting later)
    $expIcalHist = 3650; //-3650 days / 10 years (maybe an admin setting later)
    $sRange = date('Y-m-d',mktime(12,0,0) - 86400*$expIcalHist);
//    $eRange = date('Y-m-d',time()+31536000); //+1 year
    $eRange = date('Y-m-d',time()+315360000); //+10 year