[Zope] Where does Zope store files...

Samir Mishra SamirMishra@cbuae.gov.ae
Sat, 8 Mar 2003 10:44:18 +0400


And, in case someone is interested, for WIN NT systems, I use the following
batch file to archive datasets and start up the Zope service (filenames will
differ, as well as paths, obviously) -


=======================================================
@echo off

set PLONE=C:\Applications\Programming\Plone
set SSL=%PLONE%\openssl
set PYTHON=%PLONE%\Python
set ZOPE=%PLONE%\Zope
set PYTHONHOME=%PYTHON%

set PATH=%PYTHON%;%SSL%;%ZOPE%;%PATH%
set INSTANCE_HOME=%PLONE%\Data

set HTTP_MANAGE=8080

REM ----------------------
REM Debug mode
REM ----------------------
set Z_DEBUG_MODE=1
set ZOPE_SECURITY_POLICY=PYTHON

REM ----------------------
REM get todays date and time into an environment variable
REM ----------------------
set TIMENOW=%TIME: =0%
set TIMENOW=%TIMENOW::=.%
set TIMENOW=%TIMENOW:.=%

set TODAY=%DATE%
set TODAY=%TODAY:~6,4%%TODAY:~3,2%%TODAY:~0,2%

set TIMENOW=%TODAY%%TIMENOW%

REM ----------------------
REM Move the log file
REM ----------------------
move /y %INSTANCE_HOME%\Var\z2s.log %INSTANCE_HOME%\Var\%TIMENOW%-z2s.log
set EC=%ERRORLEVEL%
if %EC% GTR 0 GOTO EXIT

REM ----------------------
REM copy the object DB
REM ----------------------
copy %INSTANCE_HOME%\Var\Data.fs %INSTANCE_HOME%\Var\%TIMENOW%-Data.fs
set EC=%ERRORLEVEL%
if %EC% GTR 0 GOTO EXIT

REM ----------------------
REM copy the object DB index
REM ----------------------
copy %INSTANCE_HOME%\Var\Data.fs.index
%INSTANCE_HOME%\Var\%TIMENOW%-Data.fs.index
set EC=%ERRORLEVEL%
if %EC% GTR 0 GOTO EXIT

:START
echo Starting Service .....................
%PYTHON%\python.exe %ZOPE%\z2s.py -X -y 80 -y 8080 -y 443 -Y 8443 -f 8421
INSTANCE_HOME=%PLONE%\Data HTTP_MANAGE=%HTTP_MANAGE% -D %1 %2 %3 %4 %5

:EXIT

=======================================================

Since WinNT will lock Data.fs after ZServer has been started, copying/moving
of files has to be done before the service is started. 

Obviously, I start ZServer from a batch script, and don't use the service.

The procedure makes a backup of the data and the log each time the service
is started. You may end up with a lot of LARGE backup files. I usually use
the 200* wildcard on files to automate the archiving/deleting of these
files, but in a separate script.

Samir.




-----Original Message-----
From: Toby Dickenson [mailto:tdickenson@geminidataloggers.com]
Sent: Wednesday, March 05, 2003 21:19
To: Chris Muldrow; Paul Winkler; Sorin Marti
Cc: zope@zope.org
Subject: Re: [Zope] Where does Zope store files...


On Wednesday 05 March 2003 4:56 pm, Chris Muldrow wrote:
> Here's a backup procedure on Zope.org:
>
> http://www.zope.org/Members/jrush/howto_rsync_zope

That process is very dangerous. Your backup can be trashed if something goes

wrong mid-rsync, or soon after the rsync. Also, rsync sometimes aborts if
the 
file is changed while it is processing it, with insufficient guarantees
about 
the state of the file it leaves behind.

I recommend:

http://mail.zope.org/pipermail/zodb-dev/2002-October/003418.html

-- 
Toby Dickenson
http://www.geminidataloggers.com/people/tdickenson

_______________________________________________
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 )