> I've made a small script to cleanup the database, the demo ics file and
> restart the webapp. It can be used in cron like this:
Great, thanks.
> 1. Make a dump of the webical database in a clean state (events not
> needed, but the users and calendars are handy)
The following tables are needed:
- _auth_user
- application_settings
- auth_userrole
- calendar
- user
All of them get an insert from the clean state.
> 2. Make a copy of the demo ics file in the state you want.
I've updated http://demo.webical.org/dav/webicaldemo.ics to include
bogus recurring events, so there are always events visible.
> 3. Put both files in a place where the tomcat user can reach them
They are now in /var/sites/org.webical.demo/etc together with the script.
> 4. Edit the script and adjust the variables at the top:
> db=
> db_user=
> db_pass=
> tomcat_user=<tomcat admin user>
> tomcat_pass=<tomcat admin password>
> url=http://demo.webical.org
> context_path=/
> insert_script=<the clean database dump
> demo_ical_file=<location of the demo file in the webdav folder>
> clean_ical_file=<location of the clean copy>
Changed the wget parameters to --http-user and --http-pass (which works
on this Debian box).
> 5. Make the files readble/executable only for tomcat
> chmod 700 cleandemo (as tomcat)
Using root :)
> 6. Add it to cron
0 0 * * * root
/var/sites/org.webical.demo/etc/webicaldemoclean
er.sh
> 7. Tail the log and cross your fingers.
I've done a few command line tries, they work. I'll cross my fingers for
the crontab.
Summary: every night at 0:00 both the demo.webical.org database and the
/dav/webicaldemo.ics are reset, resulting in a clean demo experience
every day!
Best regards,
Zoran
--
Zoran Kovacevic
Func. Internet Integration
W http://www.func.nl
M +31 6 48104284
T +31 20 4230000
F +31 20 4223500
|