mirror of
https://github.com/deajan/obackup.git
synced 2024-12-26 15:33:41 +01:00
Further busybox compat. xz compression level not supported
This commit is contained in:
parent
ba8541d5f0
commit
b331ffb1f2
@ -1,6 +1,6 @@
|
|||||||
#### MINIMAL-FUNCTION-SET BEGIN ####
|
#### MINIMAL-FUNCTION-SET BEGIN ####
|
||||||
|
|
||||||
## FUNC_BUILD=2016102303
|
## FUNC_BUILD=2016102304
|
||||||
## BEGIN Generic bash functions written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
|
## BEGIN Generic bash functions written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
|
||||||
|
|
||||||
## To use in a program, define the following variables:
|
## To use in a program, define the following variables:
|
||||||
@ -8,6 +8,8 @@
|
|||||||
## INSTANCE_ID=program-instance-name
|
## INSTANCE_ID=program-instance-name
|
||||||
## _DEBUG=yes/no
|
## _DEBUG=yes/no
|
||||||
|
|
||||||
|
#TODO(high): Refactor GetRemoteOs into big oneliner for faster execution (if busybox else uname else uname -spio in one statement)
|
||||||
|
|
||||||
#TODO: Windows checks, check sendmail & mailsend
|
#TODO: Windows checks, check sendmail & mailsend
|
||||||
|
|
||||||
if ! type "$BASH" > /dev/null; then
|
if ! type "$BASH" > /dev/null; then
|
||||||
@ -1387,6 +1389,8 @@ function RsyncPatterns {
|
|||||||
function PreInit {
|
function PreInit {
|
||||||
__CheckArguments 0 $# ${FUNCNAME[0]} "$@" #__WITH_PARANOIA_DEBUG
|
__CheckArguments 0 $# ${FUNCNAME[0]} "$@" #__WITH_PARANOIA_DEBUG
|
||||||
|
|
||||||
|
local compressionString
|
||||||
|
|
||||||
## SSH compression
|
## SSH compression
|
||||||
if [ "$SSH_COMPRESSION" != "no" ]; then
|
if [ "$SSH_COMPRESSION" != "no" ]; then
|
||||||
SSH_COMP=-C
|
SSH_COMP=-C
|
||||||
@ -1477,24 +1481,34 @@ function PreInit {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
## Set compression executable and extension
|
## Set compression executable and extension
|
||||||
|
if [ "$(IsInteger $COMPRESSION_LEVEL)" -eq 0 ]; then
|
||||||
COMPRESSION_LEVEL=3
|
COMPRESSION_LEVEL=3
|
||||||
|
fi
|
||||||
|
|
||||||
|
## Busybox fix (Termux xz command doesn't support compression level as example)
|
||||||
|
if [ "$LOCAL_OS" == "BUSYBOX" ] || [ "$REMOTE_OS" == "BUSYBOX" ]; then
|
||||||
|
compressionString=""
|
||||||
|
else
|
||||||
|
compressionString=" -$COMPRESSION_LEVEL"
|
||||||
|
fi
|
||||||
|
|
||||||
if type xz > /dev/null 2>&1
|
if type xz > /dev/null 2>&1
|
||||||
then
|
then
|
||||||
COMPRESSION_PROGRAM="| xz -$COMPRESSION_LEVEL"
|
COMPRESSION_PROGRAM="| xz$compressionString"
|
||||||
COMPRESSION_EXTENSION=.xz
|
COMPRESSION_EXTENSION=.xz
|
||||||
elif type lzma > /dev/null 2>&1
|
elif type lzma > /dev/null 2>&1
|
||||||
then
|
then
|
||||||
COMPRESSION_PROGRAM="| lzma -$COMPRESSION_LEVEL"
|
COMPRESSION_PROGRAM="| lzma$compressionString"
|
||||||
COMPRESSION_EXTENSION=.lzma
|
COMPRESSION_EXTENSION=.lzma
|
||||||
elif type pigz > /dev/null 2>&1
|
elif type pigz > /dev/null 2>&1
|
||||||
then
|
then
|
||||||
COMPRESSION_PROGRAM="| pigz -$COMPRESSION_LEVEL"
|
COMPRESSION_PROGRAM="| pigz$compressionString"
|
||||||
COMPRESSION_EXTENSION=.gz
|
COMPRESSION_EXTENSION=.gz
|
||||||
# obackup specific
|
# obackup specific
|
||||||
COMPRESSION_OPTIONS=--rsyncable
|
COMPRESSION_OPTIONS=--rsyncable
|
||||||
elif type gzip > /dev/null 2>&1
|
elif type gzip > /dev/null 2>&1
|
||||||
then
|
then
|
||||||
COMPRESSION_PROGRAM="| gzip -$COMPRESSION_LEVEL"
|
COMPRESSION_PROGRAM="| gzip$compressionString"
|
||||||
COMPRESSION_EXTENSION=.gz
|
COMPRESSION_EXTENSION=.gz
|
||||||
# obackup specific
|
# obackup specific
|
||||||
COMPRESSION_OPTIONS=--rsyncable
|
COMPRESSION_OPTIONS=--rsyncable
|
||||||
|
Loading…
Reference in New Issue
Block a user