#!/usr/bin/perl
my $svn_repo = "/svn/reponame";
my $bkup_dir = "/var/backups/svn_backup/backup_reponame";
my $bkup_file = "reponame_backup-";
$bkup_file = $bkup_file . `date +%Y_%m_%d_%H_%M`;
chomp $bkup_file;
my $youngest = `svnlook youngest $svn_repo`;
chomp $youngest;
my $dump_command = "svnadmin -q dump $svn_repo > $bkup_dir/$bkup_file";
print "\nDumping Subversion repo $svn_repo to $bkup_file...\n";
print `$dump_command`;
print "Backing up through revision $youngest... \n";
print "\nCompressing dump file...\n";
print `bzip2 -9 $bkup_dir/$bkup_file\n`;
chomp $bkup_file;
my $zipped_file = $bkup_dir . "/" . $bkup_file . ".bz2";
print "\nCreated $zipped_file\n";
No comments:
Post a Comment