betabug... Sascha Welter

home english | home deutsch | Site Map | Sascha | Kontakt | Pro | Weblog | Wiki

09 July 2008

Zope Incremental Backup Script

What I use now

With your Zope installation comes the script, that allows you to do incremental backups of the ZODB (the Data.fs file). Around that script most people build a shell script and run it through a cron job. Since I just did a new installation (yeah, that's rare for me), I brushed up what I use so far. I'm now automatically keeping 2 generations of backups, whenever a "generation switch" is done, all the moving, deleting etc. is done by the script. The resulting main folder I rsync to a remote machine. Here comes the script...

In fact there are some parts of the shell script that could be done cleaner (e.g. my argument parsing suxx). But the script works and requires little to no work. Setup is by manually adjusting some paths in the script, for a solution that you want to run unchanged on many hosts, you'd likely want to do that with setup files or command line parameters.

Anyway here is what I have now:


# settings:
# (directories without ending slash "/")


# determine if full or incremental from command line argument
if [ $# -eq 1 ]; then
    if [ $1 == "-f" ]; then

if [ $TYPE == "full" ]; then
    echo "*** Full backup ..."
    mkdir -p $BACKUP_TO
    rm -r $BACKUP_TO/old
    mv $BACKUP_TO/current $BACKUP_TO/old
    mkdir $BACKUP_TO/current
    $ZOPE_HOME/bin/ -B -F -v -r $BACKUP_TO/current -f $DATA
    echo "*** Incremental backup ..."
    mkdir -p $BACKUP_TO/current
    $ZOPE_HOME/bin/ -B -v -r $BACKUP_TO/current -f $DATA

As the script is based on various pieces floating around on the net, feel free to copy, improve and share again!

My setup:

When you "pack" your Data.fs, will start with a full backup again, but the "remaining" files from the previous incremental backups won't be cleaned up. They will be taken care of in the next "generation switch", so I don't really care.

Posted by betabug at 14:13 | Comments (3) | Trackbacks (0)
ch athens
Life in Athens (Greece) for a foreigner from the other side of the mountains. And with an interest in digital life and the feeling of change in a big city. Multilingual English - German - Greek.
Main blog page
Recent Entries
Best of
Some of the most sought after posts, judging from access logs and search engine queries.

Apple & Macintosh:
Security & Privacy:
Misc technical:
Athens for tourists and visitors:
Life in general:
<< What to do in Athens when it's hot | Main | Epidaurus >>
Re: Zope Incremental Backup Script

Hey, nice recipe! I've been using for a while now, but didn't know about the incremental option (i should read more carefully about such things).

Thnx for both the recipe and the script sample!

Posted by: Wu at July 09,2008 16:42
Re: Zope Incremental Backup Script

Two questions:
1. How to do with mount points?
2. How to recover a generated backup? Must be done with


Posted by: Julian at February 14,2009 03:28
Re: Zope Incremental Backup Script

Hi Julian!

1. No idea, I don't use mount points myself.
2. Yes, recovery is done via too.

Posted by: betabug at February 14,2009 17:52
You can trackback to:
There are no trackbacks.