{"id":346,"date":"2010-02-16T18:01:35","date_gmt":"2010-02-16T17:01:35","guid":{"rendered":"http:\/\/blogs.oucs.ox.ac.uk\/adamweblearn\/?p=346"},"modified":"2010-05-27T09:54:58","modified_gmt":"2010-05-27T08:54:58","slug":"automatically-updating-a-site-from-a-database-with-a-script","status":"publish","type":"post","link":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/2010\/02\/automatically-updating-a-site-from-a-database-with-a-script\/","title":{"rendered":"Automatically updating a site from a database with a script"},"content":{"rendered":"<p>A colleague here in OUCS is using new WebLearn in a fairly novel way. They have a database (actually a subversion repository) full of HTML-based teaching material and fancied making it available in WebLearn (in addition to other places where it is currently used).<\/p>\n<p>They didn&#8217;t want to have to manually update WebLearn every time the material was updated and wondered whether we had a suggestion as to how this could be done.<\/p>\n<p>The solution that we hit upon is fairly simple. A site was created to host the material. We then set up a Webdav connection from the user&#8217;s Linux PC.<\/p>\n<p>After this a script was written which does a check-out from the repository into a temporary folder and then copies the files into the WebLearn site via Webdav. These files replace the incumbent in WebLearn and so the site is brought up to date.<\/p>\n<p>The final piece in the jigsaw is to schedule a &#8216;cron job&#8217; to run the script at 4am every Sunday night \/ Monday morning &#8211; this effectively automatically updates the WebLearn site every week ensuring that the teaching materials are more or less up to date at all times with no manual intervention.<\/p>\n<p>This scenario is not uncommon and we can provide guidance should anybody else fancy trying this.<\/p>\n<h3>Links<\/h3>\n<ul>\n<li><a href=\"https:\/\/weblearn.ox.ac.uk\/access\/content\/group\/info\/step\/webDAV20.pdf\">Webdav step-by-step guide<\/a><\/li>\n<\/ul>\n<h2><\/h2>\n","protected":false},"excerpt":{"rendered":"<p>A colleague here in OUCS is using new WebLearn in a fairly novel way. They have a database (actually a subversion repository) full of HTML-based teaching material and fancied making it available in WebLearn (in addition to other places where &hellip; <a href=\"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/2010\/02\/automatically-updating-a-site-from-a-database-with-a-script\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[90,295,105],"tags":[374],"class_list":["post-346","post","type-post","status-publish","format-standard","hentry","category-sakai","category-web","category-weblearn","tag-resources"],"_links":{"self":[{"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/posts\/346","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/comments?post=346"}],"version-history":[{"count":4,"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/posts\/346\/revisions"}],"predecessor-version":[{"id":641,"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/posts\/346\/revisions\/641"}],"wp:attachment":[{"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/media?parent=346"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/categories?post=346"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/tags?post=346"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}