You are not logged in Log in Join
You are here: Home » Members » jrush » Use Rsync to Backup Zope

Log in
Name

Password

 

Use Rsync to Backup Zope

Because Zope appends new data to the end of its OODB, and because rsync only transmits the differences between two files when copying, using rsync to back up Zope is very efficient. The only time it slows down is when you pack your OODB and it has to start over. Drop this file into your Cron directory, and it will keep backups for the last seven days, using a minimum of disk copying. It can also be used efficiently over dialup lines, on a perhaps weekly basis.
#!/bin/sh
########################################
# File: /etc/cron.daily/zbackup.cron
#
# Backup Zope Database Daily
########################################
#
# rsync arguments:
# -q       ::= Quiet operation, for cron logs
# -u       ::= Update only, don't overwrite newer files
# -t       ::= Preserve file timestamps
# -p       ::= Preserve file permissions
# -o       ::= Preserve file owner
# -g       ::= Preserve file group
# -z       ::= Compress during transfer
# -e ssh   ::= Use the ssh utility to secure the link
#
ARCHTOP="/archive/zope/"
DOW=`date +%A`
ARCHDIR="${ARCHTOP}${DOW}"
#
# Insure Our Day-of-Week Directory Exists
[ -d ${ARCHDIR} ] || mkdir ${ARCHDIR} || {
    echo "Could Not Create Day-of-Week Directory: ${ARCHDIR}" ; exit 1
}
#
/usr/bin/rsync -q -u -t -p -o -g /var/zope/var/Data.fs ${ARCHDIR}
#
ln -sf ${ARCHDIR} ${ARCHTOP}Current
#
exit 0