zope_tic_loop 1.12 KB
Newer Older
Jean-Paul Smets's avatar
Jean-Paul Smets committed
1
#!/bin/bash
2 3 4 5 6 7 8 9 10

# CMFActivity tic script.
# This script is for a standalone Zope instance running on localhost.
# For clusters, GET distribute with the number of nodes, and GET tic
# on each machine with the corresponding processing_node id.

# Make sure this user exists in the portal, and has Member role
[ -z $AUTH ] && AUTH=zope:zope
[ -z $PORT ] && PORT=9080
Jérome Perrin's avatar
Jérome Perrin committed
11
[ -z $SITE ] && SITE=erp5
12 13 14 15 16

[ -z $TMP ] && TMP=/tmp

echo Starting tic on $SITE:$PORT with $AUTH

Jean-Paul Smets's avatar
Jean-Paul Smets committed
17
while true; do
18 19 20 21 22 23 24 25 26 27 28 29 30
  # distribute on nodes
  wget -q -O $TMP/zope_distribute.out http://${AUTH}@localhost:${PORT}/${SITE}/portal_activities/distribute?node_count:int=1
  
  # execute registred activities for this node
  wget -q -O $TMP/zope_tic.out http://${AUTH}@localhost:${PORT}/${SITE}/portal_activities/tic?processing_node:int=1
  # sample for another node
  #wget -q -O $TMP/zope_tic.out http://${AUTH}@anotherhost:${PORT}/${SITE}/portal_activities/tic?processing_node:int=2
  
  # tic alarms
  wget -q -O $TMP/zope_alarm_tic.out http://${AUTH}@localhost:${PORT}/${SITE}/portal_alarms/tic
  
  # 10 is recommended on production servers, but 4 is enough for development
  sleep 4
Jean-Paul Smets's avatar
Jean-Paul Smets committed
31
done
32