File: driver_my-tar-xz_code.txt

package info (click to toggle)
backup2l 1.6-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 448 kB
  • sloc: sh: 3,194; makefile: 7
file content (29 lines) | stat: -rw-r--r-- 1,020 bytes parent folder | download | duplicates (3)
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
# Submitted by: Joachim Wiedorn  (2011-02-20)

# example driver with modern xz compression. Please note, that 
# the xz driver have quality 1...9, but only the first one should
# be used with backup2l (1, 2 or 3) because higher qualities are
# too slow for using for backup (Default quality of xz is "6").

# Use tar with the new driver XZ, here with the faster quality "3"
DRIVER_MY_TAR_XZ ()
{
    case $1 in
        -test)
            require_tools tar xz-utils
            echo "ok"
            ;;
        -suffix)
            echo "tar.xz"
            ;;
        -create)        # Arguments: $2 = BID, $3 = archive file, $4 = filelist file
            tar -c -T $4 --no-recursion | xz -z -3 > $3  2>&1
            ;;
        -toc)           # Arguments: $2 = BID, $3 = archive file
            tar -tJf $3 | sed 's#^#/#'
            ;;
        -extract)       # Arguments: $2 = BID, $3 = archive file, $4 = filelist file
            tar -xJ --same-permission --same-owner -f $3 -T $4 2>&1
            ;;
    esac
}