[[howto:web:share-your-owncloud-calendar-with-your-friends]]

Posted 22 January 2014 by Brendan Kidwell

Share Your ownCloud Calendar with Your Friends

If you store your calendar in a personal ownCloud instance, you might be scratching your head about the question of how to share your calendar data semi-publicly with your circle of friends. Google Calendar provides URLs with unique unguessable public IDs in them, which can be subscribed without authentication in any compatible calendar client. Here's how to do something similar with your ownCloud server.

In the ownCloud web interface, click the Settings button and get the Download URL for your calendar.

Create a web-accessible folder on your server outside of ownCloud that isn't password protected. It's best if you put a random number or something in the path so that only people you give the URL to will know the URL of your calendar.

Create a Bash script on your server to download the calendar to a static file:

~/bin/static-calendar-download.sh
#!/bin/bash
 
url="MY-OWNCLOUD-CALENDAR-DOWNLOAD-URL"
dest="MY-WEB-ACCESSIBLE-DOWNLOAD-FOLDER/calendar.ics"
user=MY-USERNAME
pwd="MY-PASSWORD"
 
wget \
   --quiet --output-document="$dest" \
   --auth-no-challenge \
   --http-user=$user --http-password="$pwd" \
   "$url"

Make the script executable (chmod +x ~/bin/static-calendar-downloads.sh) and run it to make sure it works once. Make sure you can access the public URL of the .ics file from a browser.

Finally, edit your crontab file using the crontab -e command and add a line for script similar to this:

13 0,12 * * * /home/apps/bin/static-calendar-download.sh

This will make a fresh snapshot of your ownCloud calendar to share at the URL you chose, at 0:13 and 12:13 every day.

Lukas, 2014-01-28 15:13

Editing the crontab file you specify the path with one folder too many.
Shouldn'n it be 13 0,12 * * * /home/bin/static-calendar-download.sh ?

Brendan Kidwell, 2014-01-28 16:03

The path is correct for my case. I install all web app related things in the home folder of the user 'apps'. I placed my script in the ~/bin folder for the 'apps' user, so the full path is /home/apps/bin/static-calendar-download.sh .

I always put full absolute paths in crontab; I'm not sure if that's necessary. $home/bin/static-calendar-download.sh might work.

To comment on this page, please copy and paste the following into an email and send it to me. Useful and informative comments will be published within a day or two.

To: brendan@glump.net
Subject: Glump.net comment - Share Your ownCloud Calendar with Your Friends

Regarding: https://www.glump.net/howto/web/share-your-owncloud-calendar-with-your-friends
My name: [your name here]
My social media or web site: [optional URL here]
Publish this comment: yes

[your comment here]