currentfeature/docs
Last change
on this file since be56db9 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 | |
---|
9 | here=`dirname $0` |
---|
10 | address="localhost" |
---|
11 | port="8081" |
---|
12 | socket="${here}/../var/zeo/zeo.sock" |
---|
13 | days=7 |
---|
14 | |
---|
15 | if [ -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" |
---|
21 | else |
---|
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 |
---|
34 | fi |
---|
Note: See
TracBrowser
for help on using the repository browser.