aboutsummaryrefslogtreecommitdiffstats
path: root/script/make-crontab
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-09-06 15:00:05 +0100
committerRobin Houston <robin.houston@gmail.com>2012-09-06 15:00:05 +0100
commit006717f1ac39557e50052bb5755d430a1fa100ee (patch)
treed07209a4ad2003111c03948d537127d40dda9799 /script/make-crontab
parent537b97ff069cac999da3ca80ede77fedc79e39ff (diff)
parent74531a783a8ea62a80596b435bd151cec2bf82c8 (diff)
Merge branch 'master' of git.mysociety.org:/data/git/public/alaveteli
Conflicts: spec/controllers/api_controller_spec.rb
Diffstat (limited to 'script/make-crontab')
-rwxr-xr-xscript/make-crontab16
1 files changed, 16 insertions, 0 deletions
diff --git a/script/make-crontab b/script/make-crontab
new file mode 100755
index 000000000..1b4fbabbd
--- /dev/null
+++ b/script/make-crontab
@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+import re
+
+mailto = "recipient-of-any-errors@localhost"
+user = "user-to-run-as"
+location = "/path/to/alaveteli"
+
+template = open("config/crontab.ugly").read()
+template = re.sub(r"MAILTO=.*", "MAILTO=%s" % mailto, template)
+template = template.replace("!!(*= $user *)!!", user)
+template = re.sub(r"/data/vhost/.*/script", location + "/script", template)
+
+print template
+
+
+