Updated svnbackup.sh to backup TRAC environment with SVN
This commit is contained in:
parent
2e539a5735
commit
1200f6792b
15
svnbackup.sh
15
svnbackup.sh
@ -1,9 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
bakdate=$(date +%Y%m%d%H%M)
|
||||
bakdate=$(date +%Y%m%d)
|
||||
|
||||
bakdest="/BACKUP/svn/"
|
||||
svnrepos="/var/lib/svn"
|
||||
tracrepos="/var/lib/trac"
|
||||
|
||||
rotate_backups() {
|
||||
find $backdest -type f -mtime +7 -exec rm -frv {} \;
|
||||
@ -14,9 +15,17 @@ rotate_backups
|
||||
|
||||
|
||||
cd $svnrepos
|
||||
|
||||
|
||||
|
||||
if [ -d "$bakdest" ] && [ -w "$bakdest" ] ; then
|
||||
for repo in *; do
|
||||
svnadmin dump $repo > $bakdest/$repo-$bakdate.svn.dump
|
||||
mkdir /tmp/$repo
|
||||
svnadmin dump $repo > /tmp/$repo/$repo-$bakdate.svn.dump
|
||||
trac-admin $tracrepos/$repo hotcopy /tmp/$repo/$repo-trac-$bakdate
|
||||
cd /tmp/
|
||||
tar -zcf $bakdest/$repo-$bakdate.tar.gz $repo/*
|
||||
rm -fr /tmp/$repo
|
||||
cd $svnrepos
|
||||
done
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user