Fix incremental backups
This commit is contained in:
parent
302b21f525
commit
eae15e525b
@ -1,11 +1,11 @@
|
||||
# $OpenBSD: Makefile,v 1.14 2012/03/29 09:30:05 giovanni Exp $
|
||||
# $OpenBSD: Makefile,v 1.15 2012/04/03 10:56:03 giovanni Exp $
|
||||
|
||||
COMMENT = MySQL backup scripts
|
||||
|
||||
V = 2.2
|
||||
DISTNAME = MySQL-zrm-$V.0
|
||||
PKGNAME = ${DISTNAME:L}
|
||||
REVISION = 2
|
||||
REVISION = 3
|
||||
CATEGORIES = databases perl5
|
||||
|
||||
HOMEPAGE = http://www.zmanda.com/
|
||||
|
@ -0,0 +1,39 @@
|
||||
$OpenBSD: patch-usr_share_mysql-zrm_plugins_socket-copy_pl,v 1.1 2012/04/03 10:56:03 giovanni Exp $
|
||||
--- usr/share/mysql-zrm/plugins/socket-copy.pl.orig Thu Feb 4 01:19:25 2010
|
||||
+++ usr/share/mysql-zrm/plugins/socket-copy.pl Tue Apr 3 12:40:28 2012
|
||||
@@ -70,7 +70,7 @@ my $REMOTE_MYSQL_BINPATH = "/usr/bin";
|
||||
# Uncomment and modify this if some other directory is to be used
|
||||
#$ENV{'TMPDIR'}="/tmp";
|
||||
|
||||
-my $TAR = "tar";
|
||||
+my $TAR = "gtar";
|
||||
my $CP="cp -pr";
|
||||
|
||||
my $MYSQL_BINPATH="/usr/bin";
|
||||
@@ -164,7 +164,7 @@ sub getCopyParameters()
|
||||
sub doLocalTar()
|
||||
{
|
||||
my $cmd;
|
||||
- my $tarCmd = "$TAR --same-owner $compress -phsC ";
|
||||
+ my $tarCmd = "$TAR --same-owner -f- $compress -phsC ";
|
||||
|
||||
my $s = $srcFile;
|
||||
$s =~ s/^"//;
|
||||
@@ -318,7 +318,7 @@ sub sendArgsToRemoteHost()
|
||||
# This will read the data from the socket and pipe the output to tar
|
||||
sub readTarStream()
|
||||
{
|
||||
- unless( open( TAR_H, "|$TAR --same-owner $compress -xphsC $destDir 2>/dev/null" ) ){
|
||||
+ unless( open( TAR_H, "|$TAR --same-owner $compress -f- -xphsC $destDir 2>/dev/null" ) ){
|
||||
die "tar failed $!";
|
||||
}
|
||||
binmode( TAR_H );
|
||||
@@ -344,7 +344,7 @@ sub readTarStream()
|
||||
#$_[1] filename
|
||||
sub writeTarStream()
|
||||
{
|
||||
- unless(open( TAR_H, "$TAR --same-owner $compress -cphsC $_[0] $_[1] 2>/dev/null|" ) ){
|
||||
+ unless(open( TAR_H, "$TAR --same-owner $compress -f- -cphsC $_[0] $_[1] 2>/dev/null|" ) ){
|
||||
&printandDie( "tar failed $!\n" );
|
||||
}
|
||||
binmode( TAR_H );
|
@ -0,0 +1,48 @@
|
||||
$OpenBSD: patch-usr_share_mysql-zrm_plugins_ssh-copy_pl,v 1.1 2012/04/03 10:56:03 giovanni Exp $
|
||||
--- usr/share/mysql-zrm/plugins/ssh-copy.pl.orig Thu Feb 4 01:19:25 2010
|
||||
+++ usr/share/mysql-zrm/plugins/ssh-copy.pl Tue Apr 3 12:41:10 2012
|
||||
@@ -52,7 +52,7 @@ $ENV{"PATH"}="/usr/local/bin:/opt/csw/bin:/bin:/usr/bi
|
||||
|
||||
my $SSH="ssh";
|
||||
my @SSH_ARR;
|
||||
-my $TAR="tar";
|
||||
+my $TAR="gtar";
|
||||
my $RM="rm";
|
||||
my $MKDIR="mkdir";
|
||||
my $LS="ls";
|
||||
@@ -273,7 +273,7 @@ sub doCreateLinks()
|
||||
|
||||
my $f = basename($tmpFile);
|
||||
my $d = dirname( $tmpFile);
|
||||
- $r = system( "$TAR --same-owner $compress -cphsC $d $f | $SSH $REMOTE_USER\@$host $TAR --same-owner $compress -xphsC $TMP_DIR" );
|
||||
+ $r = system( "$TAR --same-owner $compress -f- -cphsC $d $f | $SSH $REMOTE_USER\@$host $TAR --same-owner $compress -f- -xphsC $TMP_DIR" );
|
||||
|
||||
unlink( $tmpFile );
|
||||
if( $r > 0 ){
|
||||
@@ -291,7 +291,7 @@ sub doCreateLinks()
|
||||
sub doTar()
|
||||
{
|
||||
my $cmd;
|
||||
- my $tarCmd = "$TAR --same-owner $compress -phsC ";
|
||||
+ my $tarCmd = "$TAR --same-owner $compress -f- -phsC ";
|
||||
|
||||
my $fileList = $srcFile;
|
||||
my $lsCmd = "";
|
||||
@@ -336,7 +336,7 @@ sub doMySQLHotCopy()
|
||||
die( "mysqlhotcopy on host $host failed" );
|
||||
}
|
||||
|
||||
- $r = system( "$SSH $REMOTE_USER\@$host $TAR --same-owner $compress -cphsC $TMP_DIR . | $TAR --same-owner $compress -xphsC $destDir" );
|
||||
+ $r = system( "$SSH $REMOTE_USER\@$host $TAR --same-owner $compress -f- -cphsC $TMP_DIR . | $TAR --same-owner $compress -f- -xphsC $destDir" );
|
||||
|
||||
&removeTmpDir();
|
||||
if( $r > 0 ){
|
||||
@@ -440,7 +440,7 @@ sub doSnapshotCommand()
|
||||
|
||||
my $f = basename($fName);
|
||||
my $d = dirname( $fName);
|
||||
- $r = system( "$TAR --same-owner $compress -cphsC $d $f | $SSH $REMOTE_USER\@$host $TAR --same-owner $compress -xphsC $TMP_DIR" );
|
||||
+ $r = system( "$TAR --same-owner $compress -f- -cphsC $d $f | $SSH $REMOTE_USER\@$host $TAR --same-owner $compress -f- -xphsC $TMP_DIR" );
|
||||
|
||||
unlink( $fName );
|
||||
if( $r > 0 ){
|
Loading…
Reference in New Issue
Block a user