--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Admin/cronjob/README Tue Oct 11 20:20:32 2016 +0200
@@ -0,0 +1,13 @@
+Administrative Isabelle cronjob at TUM
+======================================
+
+- crontab: manual update on target machine
+ crontab -l
+ crontab -e
+
+- self_update: manual installation on target directory
+ cp "$ISABELLE_HOME/Admin/cronjob/self_update "$HOME/cronjob/self_update"
+
+- $HOME/cronjob/run/ -- run-time state
+
+- $HOME/cronjob/log/ -- cumulative log area
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Admin/cronjob/crontab.lxbroy10 Tue Oct 11 20:20:32 2016 +0200
@@ -0,0 +1,5 @@
+SHELL=/bin/bash
+MAILTO=wenzelm
+
+03 00 * * * $HOME/cronjob/self_update
+17 00 * * * $HOME/cronjob/isabelle/Admin/cronjob/main -f > $HOME/cronjob/run/main.out >> $HOME/cronjob/run/main.err
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Admin/cronjob/main Tue Oct 11 20:20:32 2016 +0200
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+#
+# DESCRIPTION: start the main Isabelle cronjob
+
+THIS="$(cd "$(dirname "$0")"; pwd)"
+
+source "$HOME/.bashrc"
+
+"$THIS/../build" jars || exit $?
+
+exec "$THIS/../../bin/isabelle_java" isabelle.Isabelle_Cronjob "$@"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Admin/cronjob/self_update Tue Oct 11 20:20:32 2016 +0200
@@ -0,0 +1,14 @@
+#!/bin/bash
+#
+# self-update of the administrative isabelle repository
+#
+# Need to copy this file manually to $HOME/cronjob in order to
+# avoid overwriting the running self_update by itself!
+
+source "$HOME/.bashrc"
+
+cd "$HOME/cronjob"
+mkdir -p run log
+
+hg -R isabelle pull -q || echo "self_update pull failed"
+hg -R isabelle update -C -q || echo "self_update update failed"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Pure/Admin/isabelle_cronjob.scala Tue Oct 11 20:20:32 2016 +0200
@@ -0,0 +1,43 @@
+/* Title: Pure/Admin/isabelle_cronjob.scala
+ Author: Makarius
+
+Main entry point for administrative cronjob at TUM.
+*/
+
+package isabelle
+
+
+object Isabelle_Cronjob
+{
+ def main(args: Array[String])
+ {
+ Command_Line.tool0 {
+ var force = false
+ var verbose = false
+
+ val getopts = Getopts("""
+Usage: Admin/cronjob/main [OPTIONS]
+
+ Options are:
+ -f apply force to do anything
+ -v verbose
+""",
+ "f" -> (_ => force = true),
+ "v" -> (_ => verbose = true))
+
+ val more_args = getopts(args)
+ if (more_args.nonEmpty) getopts.usage()
+
+ if (verbose) Output.writeln("This is the Isabelle cronjob")
+
+ val rc =
+ if (force) {
+ Thread.sleep(Time.seconds(30).ms)
+ 0
+ }
+ else { Output.warning("Need to apply force to do anything"); 1 }
+
+ if (rc != 0) sys.exit(rc)
+ }
+ }
+}
--- a/src/Pure/build-jars Tue Oct 11 17:00:20 2016 +0200
+++ b/src/Pure/build-jars Tue Oct 11 20:20:32 2016 +0200
@@ -9,6 +9,7 @@
## sources
declare -a SOURCES=(
+ Admin/isabelle_cronjob.scala
Concurrent/consumer_thread.scala
Concurrent/counter.scala
Concurrent/event_timer.scala