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

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

howto:web:share-your-owncloud-calendar-with-your-friends [2018-08-05 04:25] (current)
Line 1: Line 1:
 +~~META:
 +creator = Brendan Kidwell
 +&date created = 2014-01-22
 +~~
 +{{tag>​calendar owncloud}}
 +~~DISCUSSION~~
 +====== 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.
 +
 +{{:​howto:​web:​share-your-owncloud-calendar-with-your-friends:​owncloud-calendar.png?​direct&​600|}}
 +
 +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:
 +
 +<file bash ~/​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"​
 +</​file>​
 +
 +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:
 +
 +<​code>​
 +13 0,12 * * * /​home/​apps/​bin/​static-calendar-download.sh
 +</​code>​
 +
 +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.