massoo has asked for the wisdom of the Perl Monks concerning the following question:
and the log file is last_backed_up file contains svnlook youngest /cvs/satrang/software which has to represent a no which is the subversion's youngest no and not the command please help me out on how to solve this problem Thanks & Regards Prashant#!/usr/bin/perl -w # # Perform a daily backup of a Subversion repository, # using the previous most-recently-backed-up revision # to create just an incremental dump. my $svn_repos = "/cvs/satrang/software"; my $backups_dir = "/home/svnbkp"; my $next_backup_file = "daily-incremental-backup." . 'date +%Y%m%d'; open(IN, "$backups_dir/last_backed_up"); $previous_youngest = <IN>; chomp $previous_youngest; close IN; my $youngest = "svnlook youngest $svn_repos"; chomp $youngest; if($youngest eq $previous_youngest) { print "No new revisions to back up.\n"; exit 0; } # We need to backup from the last backed up revision # to the latest (youngest) revision in the repository $first_rev = $previous_youngest + 1; $last_rev = $youngest; print "Backing up revisions $first_rev to $last_rev...\n"; #$svnadmin_cmd = "svnadmin dump --incremental " . "--revision $first_rev:$last_rev ". " +$svn_repos > $backups_dir/$next_backup_file"; #'$svnadmin_cmd'; print "Compressing dump file...\n"; print 'gzip -9 $backups_dir/$next_backup_file'; open LOG, ">$backups_dir/last_backed_up"; print LOG $last_rev; close LOG;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: problem in a small script
by helphand (Pilgrim) on Jan 15, 2006 at 04:55 UTC | |
by serf (Chaplain) on Jan 16, 2006 at 00:26 UTC | |
|
Re: problem in a small script
by dorko (Prior) on Jan 15, 2006 at 05:04 UTC | |
|
Re: problem in a small script
by Fletch (Bishop) on Jan 15, 2006 at 23:26 UTC |