LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   SVN Server BAckup ? (https://www.linuxquestions.org/questions/linux-server-73/svn-server-backup-574111/)

ajeetraina 08-02-2007 12:39 AM

SVN Server BAckup ?
 
I have written a script:
#vi /etc/cron.daily/svn-backup

[code]

#!/usr/sh
svnadmin dump --incremental /home/admin/repository > /mnt/dumped


in order to take backup daily.Its working fine.Everyday it compares the old dump file and do the replacement therein and the old one is no more.
But I want the dumped file to be in zipped form.
How can I write a script to compare the zipped file and do the backup therein consuming less space
HElp

mackdav 08-02-2007 02:34 PM

I think you'd want something like

Code:

# svnadmin dump --incremental /home/admin/repository | gzip -c > /mnt/dumped.gz
Personally, though, I don't do that. I run a script through cron:

Code:

#!/bin/bash

NOW=`perl -e 'print time;'`
cd /var/backup/svn
mkdir $NOW
svnadmin dump /opt/repositories.svn/CC > $NOW/dumpfile.txt
tar cfpz $NOW.tgz $NOW
rm -rf $NOW

...then follow that up with another cronjob that does this:

Code:

45 3 * * * for i in `find /var/backup -type f -mtime +2` ; do rm -f $i ; done
The first cronjob does a full dump of the svn database and then zips it. (We are paranoid, we only do full dumps of databases and database-like applications.) Later on after that's complete, the nightly backup process runs and the full dump is taken as part of a daily backup to tape. The second cronjob deletes anything it finds in the /var/backup tree that's older than two days. That way I know I have two days of backups on disk, and I can restore the full database from any day I have tape for.


All times are GMT -5. The time now is 05:11 PM.