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

(-)a/debian/control (-1 / +2 lines)
Lines 202-208 Depends: ${misc:Depends}, ${koha:Depends}, Link Here
202
 unzip,
202
 unzip,
203
 weasyprint,
203
 weasyprint,
204
 xmlstarlet,
204
 xmlstarlet,
205
 yaz
205
 yaz,
206
 zstd
206
Suggests: mysql-server | virtual-mysql-server,
207
Suggests: mysql-server | virtual-mysql-server,
207
 letsencrypt,
208
 letsencrypt,
208
Homepage: http://koha-community.org/
209
Homepage: http://koha-community.org/
(-)a/debian/control.in (-1 / +2 lines)
Lines 34-40 Depends: ${misc:Depends}, ${koha:Depends}, Link Here
34
 unzip,
34
 unzip,
35
 weasyprint,
35
 weasyprint,
36
 xmlstarlet,
36
 xmlstarlet,
37
 yaz
37
 yaz,
38
 zstd
38
Suggests: mysql-server | virtual-mysql-server,
39
Suggests: mysql-server | virtual-mysql-server,
39
 letsencrypt,
40
 letsencrypt,
40
Homepage: http://koha-community.org/
41
Homepage: http://koha-community.org/
(-)a/debian/scripts/koha-dump (-5 / +5 lines)
Lines 75-81 dump_instance() Link Here
75
    mysqlpass="$( xmlstarlet sel -t -v 'yazgfs/config/pass' $kohaconfig )"
75
    mysqlpass="$( xmlstarlet sel -t -v 'yazgfs/config/pass' $kohaconfig )"
76
    backupdir="$( xmlstarlet sel -t -v 'yazgfs/config/backupdir' $kohaconfig || true )"
76
    backupdir="$( xmlstarlet sel -t -v 'yazgfs/config/backupdir' $kohaconfig || true )"
77
    [ -z "$backupdir" ] && backupdir="/var/spool/koha/$name"
77
    [ -z "$backupdir" ] && backupdir="/var/spool/koha/$name"
78
    dbdump="$backupdir/$name-$date.sql.gz"
78
    dbdump="$backupdir/$name-$date.sql.zst"
79
    dbflag="--databases"
79
    dbflag="--databases"
80
    [ "$without_db_name" = "yes" ] && dbflag=""
80
    [ "$without_db_name" = "yes" ] && dbflag=""
81
    if [ "$schema_only" = "yes" ]
81
    if [ "$schema_only" = "yes" ]
Lines 90-103 dump_instance() Link Here
90
        [ "$quiet" = "no" ] && echo "* DB to $dbdump"
90
        [ "$quiet" = "no" ] && echo "* DB to $dbdump"
91
        mysqldump $dbflag --host="$mysqlhost" --single-transaction \
91
        mysqldump $dbflag --host="$mysqlhost" --single-transaction \
92
            --user="$mysqluser" --password="$mysqlpass" "$mysqldb" |
92
            --user="$mysqluser" --password="$mysqlpass" "$mysqldb" |
93
            gzip > "$dbdump"
93
            zstd > "$dbdump"
94
        chown "root:$name-koha" "$dbdump"
94
        chown "root:$name-koha" "$dbdump"
95
        chmod g+r "$dbdump"
95
        chmod g+r "$dbdump"
96
96
97
        instancefile="$name.conf"
97
        instancefile="$name.conf"
98
98
99
        # Dump configs, logs, etc.
99
        # Dump configs, logs, etc.
100
        metadump="$backupdir/$name-$date.tar.gz"
100
        metadump="$backupdir/$name-$date.tar.zst"
101
        output="* configs, logs"
101
        output="* configs, logs"
102
102
103
        if [ "$exclude_indexes" = "yes" ]; then
103
        if [ "$exclude_indexes" = "yes" ]; then
Lines 129-135 dump_instance() Link Here
129
        set +e
129
        set +e
130
130
131
        if [ "$exclude_logs" = "yes" ]; then
131
        if [ "$exclude_logs" = "yes" ]; then
132
            tar -czf "$metadump" -C / $excludes \
132
            tar -caf "$metadump" -C / $excludes \
133
                "etc/koha/sites/$name" \
133
                "etc/koha/sites/$name" \
134
                "etc/apache2/sites-available/$instancefile" \
134
                "etc/apache2/sites-available/$instancefile" \
135
                "etc/apache2/sites-enabled/$instancefile" \
135
                "etc/apache2/sites-enabled/$instancefile" \
Lines 137-143 dump_instance() Link Here
137
                $uploaded_files_dir \
137
                $uploaded_files_dir \
138
                $uploaded_temp_files_dir
138
                $uploaded_temp_files_dir
139
        else
139
        else
140
            tar -czf "$metadump" -C / $excludes \
140
            tar -caf "$metadump" -C / $excludes \
141
                "etc/koha/sites/$name" \
141
                "etc/koha/sites/$name" \
142
                "etc/apache2/sites-available/$instancefile" \
142
                "etc/apache2/sites-available/$instancefile" \
143
                "etc/apache2/sites-enabled/$instancefile" \
143
                "etc/apache2/sites-enabled/$instancefile" \
(-)a/debian/scripts/koha-run-backups (-2 / +3 lines)
Lines 81-86 do Link Here
81
            backupdir="$dirname/$name";
81
            backupdir="$dirname/$name";
82
        fi
82
        fi
83
83
84
        find $backupdir -maxdepth 1 \( -mtime +$days -or -mtime $days \) -name $name-'[1-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9].???'.gz  \( -name \*.sql.gz -or -name \*.tar.gz \) -print0 | xargs -0 -r rm
84
        name_q=$(perl -s -e 'print quotemeta($name)' -- -name="$name")
85
        find $backupdir -maxdepth 1 -type f -mtime +$((days - 1)) -regextype posix-egrep \
86
            -regex '.*/'"$name_q"'-[1-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\.(sql|tar)\.(gz|zst)$' -delete
85
    fi
87
    fi
86
done
88
done
87
- 

Return to bug 42028