Howto get a calendar content as .ics file

Ask all your questions regarding OC 5.x Please read the Support Forum Rules
Forum rules
ownCloud 5.x reached end of life and is officially unsupported. For details see Wiki page.

Please upgrade your ownCloud.
eMarcus
Helpful Elf
Posts: 136
Joined: Tue Jan 31, 2012 11:25 am

Howto get a calendar content as .ics file

Postby eMarcus » Thu Jun 28, 2012 3:29 pm

Hi,

I know how to export my calendar as an .ics file using the web interface, but I would like to do that automatically, so that I would frequently grab my calandar and store it in an .ics file for (ics) applications to use it.

any idea how to do that?

Thanks,
bye
Marcus.

User avatar
tanghus
Starter
Posts: 80
Joined: Sat Jan 21, 2012 6:14 pm

Re: Howto get a calendar content as .ics file

Postby tanghus » Thu Jul 05, 2012 12:00 pm

I download my calendar(s) regularly using wget: http://tanghus.net/2012/04/backup-owncl ... -contacts/

FordPrefect
Helpful Elf
Posts: 144
Joined: Tue Feb 28, 2012 12:10 am

Re: Howto get a calendar content as .ics file

Postby FordPrefect » Sat Jul 07, 2012 12:42 am

tanghus wrote:I download my calendar(s) regularly using wget: http://tanghus.net/2012/04/backup-owncl ... -contacts/


Followed your instructions, but doesn't work for me :-(

Firstly the parameter is called

Code: Select all

... --http-passwd= ...
in my version of wget. And then, owncloud seems to send back a http page rather than the calendar or contacts file. I'm using v4.04 by the way. Which version are you using? Does this method still work on v4.04?

FordPrefect
Helpful Elf
Posts: 144
Joined: Tue Feb 28, 2012 12:10 am

Re: Howto get a calendar content as .ics file

Postby FordPrefect » Sat Jul 07, 2012 2:04 pm

tanghus wrote:I download my calendar(s) regularly using wget: http://tanghus.net/2012/04/backup-owncl ... -contacts/


OK, I have managed to make that work for me. Not sure if there are different "dialects" of wget around, but for me it works following tanghus description, but with modifications as follows:

1. The download script

Code: Select all

#!/bin/sh
DATE=`date +"%Y-%W"`

# Download and gzip contacts.
wget --auth-no-challenge --no-clobber \
  -O $HOME/pimdata_backup/contacts-$DATE.vcf "http://<server-path to owncloud>/?app=contacts&getfile=export.php?bookid=<number>"
gzip -f $HOME/pimdata_backup/contacts-$DATE.vcf

# Download and gzip calendar.
wget --auth-no-challenge --no-clobber \
  -O $HOME/pimdata_backup/calendar-$DATE.ics "http://<server-path to owncloud>/?app=calendar&getfile=export.php?calid=<number>"
gzip -f $HOME/pimdata_backup/calendar-$DATE.ics

Needless to say, but you have to replace <server-path to owncloud> and <number> with your specific values. Please mind the differences to tanghus description. For one, as he pointed out on his page, I left out any user/password information, which makes the script more generic. And secondly, please mind the quote characters around the URL. Without them, the URL was not parsed in its wholeness.

2. a .netrc file holding the access information

Code: Select all

machine <server-name> login <username> password <password>

This file needs to be stored in your home directory. My wget command automatically picks it up from there.

Dear Windows users: I have no idea of an equivalent Windows approach, sorry. Thanks tanghus for that nice approach! Now storing my data regularly by means of a cron job.

dcarrco
Beginner
Posts: 10
Joined: Wed Jul 09, 2014 6:25 pm
ownCloud version: 6.0.3
Webserver: Apache
Database: SQLite
OS: Linux

Re: Howto get a calendar content as .ics file

Postby dcarrco » Wed Jul 09, 2014 6:32 pm

i have been using this method to backup my calendar and contacts in a cron job. works great and has saved me a few times when my owncloud went down. unfortunately in the last few weeks it has stopped working. i am getting a "GnuTLS: A TLS warning alert has been received." error returned from the wget command.

my wget line is

Code: Select all

wget --auth-no-challenge --no-check-certificate  \
      -O contacts.vcf "https://myserver.com/owncloud/?app=contacts&getfile=export.php?bookid=1"


(i added the --no-check-certificate in order to try to solve the problem. i also tried to specify SSL and not TLS). i read that there may have been a change in the wget. anyone have any ideas?

RealRancor
ownCloud master
Posts: 17381
Joined: Sat May 26, 2012 3:00 pm
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 7.0.x

Re: Howto get a calendar content as .ics file

Postby RealRancor » Wed Jul 09, 2014 7:48 pm

Hi,

as ownCloud is served by your Webserver you might want to ask such questions related to used tools or webservers on a linux specific forums where you probably get better answers on such non-ownCloud related questions.

*Edit*

Ah, just saw that you have already fixed this issue in wget:

viewtopic.php?f=26&t=22189
*gone*

dcarrco
Beginner
Posts: 10
Joined: Wed Jul 09, 2014 6:25 pm
ownCloud version: 6.0.3
Webserver: Apache
Database: SQLite
OS: Linux

Re: Howto get a calendar content as .ics file

Postby dcarrco » Fri Jul 11, 2014 2:05 am

its true, owncloud is served by my webserver. i did figure it out, thankfully. however it seems disingenuous and certainly not helpful to direct me to linux or apache forums. i guess maybe they would direct me to AMD because that's who made my processor, or maybe i should talk to my ISP because after all my internet comes through them?

if you dont know the answer or anything helpful, thats fine. passing me on to other folks who will undoubtedly say "owncloud is a complicated piece of software, better ask over there" is just pointless. i feel i posted my question in a thread that was very much in context. it is truly owncloud related, as it has to do with retrieving my owncloud stored data from an owncloud program layer which just happens to be on top of an apache server.

RealRancor
ownCloud master
Posts: 17381
Joined: Sat May 26, 2012 3:00 pm
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 7.0.x

Re: Howto get a calendar content as .ics file

Postby RealRancor » Fri Jul 11, 2014 7:17 am

Hu,

as SSL/TLS stuff is not handled by ownCloud (luckily it doesn't implement this transport layer) but by your webserver it should be clear that forums dedicated to such software are definitely the best place to ask this. ;)

Anyway. You found this problem in wget and got this to work.
*gone*

User avatar
RandolphCarter
ownCloud master
Posts: 5134
Joined: Wed May 30, 2012 8:42 am
ownCloud version: 8.1.1
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.5.x

Re: Howto get a calendar content as .ics file

Postby RandolphCarter » Fri Jul 11, 2014 8:06 am

i did figure it out

Would you be so kind as to post the solution? So that future users coming here from a search engine or the like might also know how to solve it easily; that would be awesome!

RealRancor
ownCloud master
Posts: 17381
Joined: Sat May 26, 2012 3:00 pm
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 7.0.x

Re: Howto get a calendar content as .ics file

Postby RealRancor » Fri Jul 11, 2014 8:41 am

Hi,

see the link above :)

https://forum.owncloud.org/viewtopic.php?f=26&t=22189

The user had to recompile a specific wget version which shows me that a linux specific forums where indeed the best pointer.
*gone*


  • Similar Topics
    Replies
    Views
    Last post

Return to “ownCloud Community Edition 5.x and older”

Who is online

Users browsing this forum: No registered users and 3 guests