View | Details | Raw Unified | Return to bug 21903
Collapse All | Expand All

(-)a/debian/scripts/koha-dump (-2 / +24 lines)
Lines 44-49 $scriptname [--quiet|-q] [--exclude-indexes] instancename1 [instancename2...] Link Here
44
$scriptname -h|--help
44
$scriptname -h|--help
45
45
46
    --exclude-indexes     Include Zebra indexes on the backup.
46
    --exclude-indexes     Include Zebra indexes on the backup.
47
    --uploaded_files      Include uploaded files.
48
    --uploaded_temp_files Include temporary uploaded files.
47
    --quiet|-q            Make the script avoid printing to STDOUT
49
    --quiet|-q            Make the script avoid printing to STDOUT
48
                          (useful for calling from another scripts).
50
                          (useful for calling from another scripts).
49
    --help|-h             Display this help message
51
    --help|-h             Display this help message
Lines 79-97 dump_instance() Link Here
79
81
80
    # Dump configs, logs, etc.
82
    # Dump configs, logs, etc.
81
    metadump="$backupdir/$name-$date.tar.gz"
83
    metadump="$backupdir/$name-$date.tar.gz"
82
    [ "$quiet" = "no" ] && echo "* configs, logs to $metadump"
84
    [ "$quiet" = "no" ] && echo "* configs, files, logs to $metadump"
83
85
84
    if [ "$exclude_indexes" = "yes" ]; then
86
    if [ "$exclude_indexes" = "yes" ]; then
85
        excludes="--exclude=var/lib/koha/$name/biblios \
87
        excludes="--exclude=var/lib/koha/$name/biblios \
86
                  --exclude=var/lib/koha/$name/authorities"
88
                  --exclude=var/lib/koha/$name/authorities"
87
    fi
89
    fi
88
90
91
    if [ "$uploaded_files" = "yes" ]; then
92
        # Remove leading /
93
        uploaded_files_dir=$(echo $(get_upload_path $name) | cut -c 2-)
94
    fi
95
96
    if [ "$uploaded_temp_files" = "yes" ]; then
97
        # Remove leading /
98
        tempdir=$(echo $(get_tmp_path $name) | cut -c 2-)
99
        uploaded_temp_files_dir="$tempdir/koha_${name}_upload"
100
    fi
101
89
    tar -czf "$metadump" -C / $excludes \
102
    tar -czf "$metadump" -C / $excludes \
90
        "etc/koha/sites/$name" \
103
        "etc/koha/sites/$name" \
91
        "etc/apache2/sites-available/$instancefile" \
104
        "etc/apache2/sites-available/$instancefile" \
92
        "etc/apache2/sites-enabled/$instancefile" \
105
        "etc/apache2/sites-enabled/$instancefile" \
93
        "var/lib/koha/$name" \
106
        "var/lib/koha/$name" \
94
        "var/log/koha/$name"
107
        "var/log/koha/$name" \
108
        $uploaded_files_dir \
109
        $uploaded_temp_files_dir
110
95
111
96
    [ "$quiet" = "no" ] && echo "Done."
112
    [ "$quiet" = "no" ] && echo "Done."
97
}
113
}
Lines 106-111 while [ $# -gt 0 ]; do Link Here
106
        --exclude-indexes)
122
        --exclude-indexes)
107
            exclude_indexes="yes"
123
            exclude_indexes="yes"
108
            shift ;;
124
            shift ;;
125
       --uploaded_files)
126
            uploaded_files="yes"
127
            shift ;;
128
        --uploaded_temp_files)
129
            uploaded_temp_files="yes"
130
            shift ;;
109
        -h|--help)
131
        -h|--help)
110
            usage ; exit 0 ;;
132
            usage ; exit 0 ;;
111
        -q|--quiet)
133
        -q|--quiet)
(-)a/debian/scripts/koha-functions.sh (-1 / +20 lines)
Lines 325-330 get_max_record_size() Link Here
325
    fi
325
    fi
326
}
326
}
327
327
328
get_tmp_path()
329
{
330
    local instancename=$1
331
    local retval=$(run_safe_xmlstarlet $instancename tmp_path)
332
    if [ "$retval" != "" ]; then
333
        echo "$retval"
334
        return 0
335
    fi
336
}
337
338
get_upload_path()
339
{
340
    local instancename=$1
341
    local retval=$(run_safe_xmlstarlet $instancename upload_path)
342
    if [ "$retval" != "" ]; then
343
        echo "$retval"
344
        return 0
345
    fi
346
}
347
328
get_tmpdir()
348
get_tmpdir()
329
{
349
{
330
    if [ "$TMPDIR" != "" ]; then
350
    if [ "$TMPDIR" != "" ]; then
331
- 

Return to bug 21903