File: driver_my-tar-lz_code.txt

package info (click to toggle)
backup2l 1.6-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 784 kB
  • sloc: sh: 8,327; makefile: 7
file content (34 lines) | stat: -rw-r--r-- 1,220 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Submitted by: Amedee Van Gasse  (2009-10-16 15:25)
# 
# I would like to donate a .tar.lz driver that I have written for myself.
# It uses lzip, which uses LZMA compression. LZMA compresses better than
# bzip2, but at the expense of more memory usage.
# 
# Please test it and let me know what can be improved.


# This driver uses tar and LZMA (lzip) compression. LZMA compresses better than
# bzip2, but at the expense of more memory usage. (donated by Amedee Van Gasse)
DRIVER_MY_TAR_LZ ()
{
    case $1 in
        -test)
            require_tools tar lzip
            echo "ok"
            ;;
        -suffix)
            echo "tar.lz"
            ;;
        -create)        # Arguments: $2 = BID, $3 = archive file name, $4 = file list file
            tar -c --no-recursion -T $4 | lzip --best -c > $3 2>&1 \
                | grep -v 'tar: Removing leading .* from .*'
            ;;
        -toc)           # Arguments: $2 = BID, $3 = archive file name
            lzip -d $3 -c | tar t | sed 's#^#/#'
            ;;
        -extract)       # Arguments: $2 = BID, $3 = archive file name, $4 = file list file
            lzip -d $3 -c | tar -x --same-permission --same-owner -T $4 2>&1
            ;;
    esac
}