Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

support lzop

  • Loading branch information...
commit f4982393f4c92bac9baa8f05f3b90820fde90fe1 1 parent c20defd
@kazuho authored
Showing with 20 additions and 14 deletions.
  1. +7 −8 blockdiff_backup
  2. +7 −4 ssh_blockdiff_dump
  3. +6 −2 ssh_lvm_dump
View
15 blockdiff_backup
@@ -10,11 +10,14 @@ if [ "$#" -eq "0" ] ; then
exit 1
fi
BACKUP_CMD="\"$1\""
+FILE_EXT=
shift
while [ "$#" -ne "0" ] ; do
- if [ "$1" = "-z" ] ; then
- # nasty way to detect gzip usage
- USE_GZIP=1
+ # nasty way to detect gzip usage
+ if [ "$1" = "-z" -o "$1" = "--gzip" ] ; then
+ FILE_EXT=.gz
+ elif [ "$1" = "--lzop" ] ; then
+ FILE_EXT=.lzop
fi
BACKUP_CMD="$BACKUP_CMD \"$1\""
shift
@@ -34,11 +37,7 @@ if [ -e "$BACKUP_NAME.ver" ] ; then
exit $EXIT_CODE
fi
fi
-if [ "$USE_GZIP" ] ; then
- BACKUP_FILE="$BACKUP_NAME.$NEXT_VER.gz"
-else
- BACKUP_FILE="$BACKUP_NAME.$NEXT_VER"
-fi
+BACKUP_FILE="$BACKUP_NAME.$NEXT_VER$FILE_EXT"
# backup
if [ "$NEXT_VER" -ne "1" ] ; then
View
11 ssh_blockdiff_dump
@@ -1,8 +1,11 @@
#! /bin/sh
# check args
-if [ "$1" = "-z" ] ; then
- USE_GZIP=1
+if [ "$1" = "-z" -o "$1" = "--gzip" ] ; then
+ COMPRESS_PROG=gzip
+ shift
+elif [ "$1" = "--lzop" ] ; then
+ COMPRESS_PROG=lzop
shift
fi
SSH_ARGS="$1"
@@ -62,8 +65,8 @@ fi
if [ "$BLOCKSIZE" ] ; then
CMD="BLOCKSIZE=$BLOCKSIZE $CMD"
fi
-if [ "$USE_GZIP" ] ; then
- CMD="$CMD | gzip ; exit \`test \"\${PIPESTATUS[0]}\" -eq 0 -a \"\$?\" -eq 0\`"
+if [ "$COMPRESS_PROG" ] ; then
+ CMD="$CMD | $COMPRESS_PROG ; exit \`test \"\${PIPESTATUS[0]}\" -eq 0 -a \"\$?\" -eq 0\`"
fi
if [ "$VERBOSE" ] ; then
echo "issuing $CMD" >&2
View
8 ssh_lvm_dump
@@ -6,8 +6,8 @@ if [ ! "$BLOCKSIZE" ] ; then
fi
# check args
-if [ "$1" = "-z" ] ; then
- SSH_BLOCKDIFF_ARGS="-z"
+if [ "$1" = "-z" -o "$1" = "--gzip" -o "$1" = "--lzop" ] ; then
+ SSH_BLOCKDIFF_ARGS=$1
shift
fi
SSH_ARGS="$1"
@@ -83,6 +83,10 @@ Ssh_lvm_dump is a wrapper script that uses L<ssh_blockdiff_dump> to take backups
compress output using L<gzip>
+=head2 --lzop
+
+compress output using L<lzop>
+
=head1 SEE ALSO
L<App::Blockdiff> - for general information
Please sign in to comment.
Something went wrong with that request. Please try again.