[Zope] ZODB packing

Cornel Nitu c.nitu@finsiel.ro
Mon, 10 Feb 2003 16:29:33 +0200


Hi,

Maybe the following script will help you:

http://webdev.zopeonarope.com/ch16/listings.html


             01 #!/bin/sh
             02 ########################################
             03 # File: /etc/cron.daily/zbackup.cron
             04 #
             05 # Backup Zope Database Daily
             06 ########################################
             07 #
             08 # rsync arguments:
             09 # -q       ::= Quiet operation, for cron logs
             10 # -u       ::= Update only, don't overwrite newer files
             11 # -t       ::= Preserve file timestamps
             12 # -p       ::= Preserve file permissions
             13 # -o       ::= Preserve file owner
             14 # -g       ::= Preserve file group
             15 # -z       ::= Compress during transfer
             16 # -e ssh   ::= Use the ssh utility to secure the link
             17 #
             18 ARCHTOP="/home/steve/archive/zope/"
             19 CRONDIR="/home/steve/crons"
             20 DOW=`date +%A`
             21 ARCHDIR="${ARCHTOP}${DOW}"
             22 RSYNC="/usr/local/bin/rsync"
             23 ZCLIENT="/usr/local/bin/python 
/usr/local/etc/Zope2/lib/python/ZPublisher/Client.py"
             24 . ${CRONDIR}/auth.conf
             25
             26 #
             27 # Insure Our Day-of-Week Directory Exists
             28 [ -d ${ARCHDIR} ] || mkdir ${ARCHDIR} || {
             29     echo "Could Not Create Day-of-Week Directory: 
${ARCHDIR}" ; exit 1
             30 }
             31
             32
             33 THISZOPE="Zope2"
             34 THISZOPEDIR="/usr/local/etc/${THISZOPE}"
             35 THISARCHDIR="${ARCHDIR}/${THISZOPE}"
             36
             37 [ -d ${THISARCHDIR} ] || mkdir ${THISARCHDIR} || {
             38     echo "Could Not Create Zope Directory: ${THISARCHDIR}" 
; exit 1
             39 }
             40
             41 . ${THISZOPEDIR}/zope.conf
             42
             43 THISZPORT=$(($ZPORT + 80))
             44
             45 #
             46 ${RSYNC}  -q -u -t -p -o -g ${THISZOPEDIR}/var/Data.fs 
${THISARCHDIR}
             47 #
             48 #
             49 # pack database...
             50 #
             51 #
             52 ${ZCLIENT} -u ${ZAUTH} 
http://localhost:${THISZPORT}/Control_Panel/manage_pack days:float=0
             53 #


At 03:27 PM 2/10/2003 +0100, you wrote:
>Hi,
>
>My apologies if this is a FAQ, I asked Google first but found nothing
>satisfactory.
>
>I would like to execute a cron job to regularly pack the ZODB. As I
>don't want to use ZEO, I plan to use wget for this. Are there other
>alternatives I missed ?
>
>Besides, I wonder if it is safe to do pack the ZODB while zope is
>running.
>
>--
>Nicolas Romero, adp3i <http://www.adp3i.fr>
>
>
>_______________________________________________
>Zope maillist  -  Zope@zope.org
>http://mail.zope.org/mailman/listinfo/zope
>**   No cross posts or HTML encoding!  **
>(Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )