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>
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 )
--On Montag, 10. Februar 2003 15:27 +0100 Nicolas Romero <Nicolas.Romero@adp3i.fr> 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 ?
wget should work fine.
Besides, I wonder if it is safe to do pack the ZODB while zope is running.
It is safe. -aj
Le lun 10/02/2003 à 15:34, Andreas Jung a écrit :
--On Montag, 10. Februar 2003 15:27 +0100 Nicolas Romero <Nicolas.Romero@adp3i.fr> wrote:
Many thanks to you and Cornel Nitu for your quick replies.
Besides, I wonder if it is safe to do pack the ZODB while zope is running.
It is safe.
And what happens if users add some content to the site during the packing ?
-aj
-- Nicolas Romero, adp3i <http://www.adp3i.fr>
[Nicolas Romero wrote (Nicolas.Romero@adp3i.fr) on 2/10/03 9:27 AM]
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 ?
make sure when you pack to leave a day's worth of transactions in your db as (i have read) if you leave 0 as the default 3 of day's transactions to save, then you can get dangling refs. <--> george donnelly - http://zettai.net/ - "We Love Newbies" :) Zope Hosting - Dynamic Website Design - Search Engine Promotion Yahoo, AIM: zettainet - ICQ: 51907738 - e:george@zettai.net
participants (4)
-
Andreas Jung -
Cornel Nitu -
george donnelly -
Nicolas Romero