source: OpenWorkouts-current/bin/zeo_pack

current
Last change on this file was d98641b, checked in by Borja Lopez <borja@…>, 5 years ago

Fixed permissions on the helper scripts under bin/

  • Property mode set to 100755
File size: 933 bytes
Line 
1#!/bin/sh
2#
3# Script to pack the ZODB served by the ZEO server
4#
5# You have to set some values for the address, port, socket, days, etc
6# variables before running this script.
7#
8
9here=`dirname $0`
10address="localhost"
11port="8081"
12socket="${here}/../var/zeo/zeo.sock"
13days=7
14
15if [ -S ${socket} ]; then
16    echo "Found unix socket: ${socket}"
17    echo "Packing database"
18    # If the unix socket exists, pack the db connecting to ZEO using it
19    zeopack -d ${days} -U ${socket}
20    echo "Done"
21else
22    # check if there is a ZEO instance running in this address/port
23    nc -z ${address} ${port} > /dev/null
24    if [ $? == 0 ]; then
25        echo "Found running server (tcp): ${address}:${port}"
26        echo "Packing database"
27        # something is running there, try to pack the db
28        zeopack -d ${days} -h ${address} -p ${port}
29        echo "Done"
30    else
31        echo "Nor a valid unix socket neither an available tcp port could be"
32        echo "found, aborting"
33    fi
34fi
Note: See TracBrowser for help on using the repository browser.