start poll_prefix from cron
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 5 Apr 2011 17:14:43 +0000 (19:14 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 5 Apr 2011 17:14:43 +0000 (19:14 +0200)
This first checks if there is poll_prefix queued already and
exit 1 if it does

cron.sh [new file with mode: 0755]

diff --git a/cron.sh b/cron.sh
new file mode 100755 (executable)
index 0000000..dd695e6
--- /dev/null
+++ b/cron.sh
@@ -0,0 +1,10 @@
+#!/bin/bash -x
+
+running=`echo status | nc -w 1 localhost 4730 | grep ^poll_prefix | cut -d"    " -f2`
+if [ "$running" -gt 0 ] ; then
+       echo "poll allready queued!"
+       exit 1
+fi
+
+time echo | gearman -N -f poll_prefix
+