1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2025-12-14 18:36:02 +00:00
Commit Graph

68 Commits

Author SHA1 Message Date
Claas Flint
1b833be760 Replace pigz with zstd for backup compression (#6897)
* Replace pigz with zstd for backup compression

This change replaces pigz (parallel gzip) with zstd (Zstandard) as the
compression algorithm for mailcow backups while maintaining full backward
compatibility with existing .tar.gz backups.

Benefits:
- Better compression ratios (12-37% improvement in tests)
- Improved compression speed with modern algorithm
- Maintains rsyncable functionality for incremental backups
- Full backward compatibility for restoring old .tar.gz backups
- Wide industry adoption and active development

Changes:
- Backup compression: pigz --rsyncable -p → zstd --rsyncable -T
- Backup decompression: pigz -d -p → zstd -d -T
- File extensions: .tar.gz → .tar.zst
- Added get_archive_info() function for intelligent format detection
- Updated backup Dockerfile to install zstd alongside pigz
- Restore function now auto-detects and handles both formats
- Updated FILE_SELECTION regex to recognize both .tar.zst and .tar.gz
- Updated comments to reflect new file extension

Backward Compatibility:
- Restore automatically detects .tar.zst (preferred) or .tar.gz (legacy)
- Existing .tar.gz backups can still be restored without issues
- pigz remains installed in backup image for legacy support
- Graceful fallback if backup file format not found

Testing:
- Added comprehensive test suite (test_backup_and_restore.sh)
- 12 automated tests covering all scenarios:
  * Backup creation (both formats)
  * Restore (both formats)
  * Format detection and priority
  * Error handling (missing files, empty dirs)
  * Content integrity verification
  * Multi-threading configuration
  * Large file compression (8.59 MB realistic data)

Test Results:
✓ zstd compression working
✓ pigz compression working (legacy)
✓ zstd decompression working
✓ pigz decompression working (backward compatible)
✓ Archive detection working
✓ Content integrity verified
✓ Format priority correct (.tar.zst preferred)
✓ Error handling for missing files
✓ Error handling for empty directories
✓ Multi-threading configuration verified
✓ Large file compression: 37.05% improvement
✓ Small file compression: 12.18% improvement

* move testing script into development folder

---------

Co-authored-by: DerLinkman <niklas.meyer@servercow.de>
2025-11-12 10:06:36 +01:00
Bruno Antunes
65d872cc14 Fix tiny typo 2025-03-27 20:21:25 +00:00
Peter
3c9d0c9d57 use ghcr.io for backupimage (#6333)
* use ghcr.io for backup image

* backup script: use renamed script + improved build of image

---------

Co-authored-by: DerLinkman <niklas.meyer@servercow.de>
2025-02-27 10:58:23 +01:00
FreddleSpl0it
6831f94fdb [Redis] redis-cli suppress auth warning 2024-11-19 15:10:52 +01:00
FreddleSpl0it
89fb1322c6 Enable password protection for Redis 2024-11-19 14:25:31 +01:00
Niklas Meyer
8b933f1967 Merge pull request #5934 from muhlba91/fix/restore-docker 2024-08-08 08:47:12 +02:00
Niklas Meyer
aadeeb0df3 Merge pull request #5634 from torzech/proper-threads-regex
Enhanced regular expression for THREADS parameter
2024-07-09 10:10:42 +02:00
Daniel Muehlbachler-Pietrzykowski
ffeeb179e1 restore: remove tty requirement from restore process to allow for automated restores 2024-07-03 10:53:37 +02:00
DerLinkman
accedf0280 Updated mailcow Components to be ARM64 compatible 2024-01-17 10:14:36 +01:00
Tomasz Orzechowski
6dc0bdbfa3 Proper number of threads regex. 2024-01-09 22:03:24 +01:00
Peter
ff7102468e [Helper] Backup and restore: Use latest tag for image 2022-11-22 18:38:38 +01:00
DerLinkman
50d2671d75 Fixed leading / warning removal 2022-10-25 10:06:53 +02:00
DerLinkman
b73d879f3c Removed thread prompt again. Added notice message 2022-10-25 09:55:29 +02:00
DerLinkman
65ca42ca42 Restored Thread Prompt due to implementation in restore 2022-10-24 15:10:15 +02:00
DerLinkman
b22ff59f7b Added PIGZ for Restoring as well. 2022-10-24 12:28:41 +02:00
DerLinkman
58527857d9 Removed debug message 2022-10-21 11:54:23 +02:00
DerLinkman
6306c4555c Removed Thread Prompt and set default value to 1 Thread 2022-10-21 11:48:29 +02:00
DerLinkman
8026b6c874 Swapped PIGZ instead of gzip 2022-10-19 11:15:12 +02:00
DerLinkman
925b220905 Compose Version detection implemented in Backup script 2022-08-22 10:24:38 +02:00
DerLinkman
6195b7c334 [Backup Script]Check for docker and docker-compose in each step seperate 2022-07-08 13:29:05 +02:00
DerLinkman
452daf5d5e Restored docker-compose Command 2022-06-23 08:55:06 +02:00
DerLinkman
872fa07213 Restore docker-compose check in scripts 2022-06-16 12:49:17 +02:00
DerLinkman
5d14baa43a Fixed typo for previous commit 2022-06-07 18:38:43 +02:00
DerLinkman
141b397c82 Fix Docker Compose recognition for docker-compose syntax 2022-06-07 18:34:41 +02:00
DerLinkman
74baf20feb Optimized if-else arguments and outputs 2022-06-07 14:45:19 +02:00
FreddleSpl0it
958112af6b [Compose] Remove >&2 in if block 2022-06-07 14:07:35 +02:00
FreddleSpl0it
08d0f9448e [Compose] move then in if statement 2022-06-07 13:59:59 +02:00
Niklas Meyer
714511b0a8 [Compose] Update to Docker Compose v2 (#4605)
* Change default HTTP_BIND, HTTPS_BIND

https://github.com/mailcow/mailcow-dockerized/issues/4315#issuecomment-1083034329

* [Compose] Removed Colon after fallback IP in docker-compose.yml

* [Compose] Remove bind options from volumes (#4577)

(cherry picked from commit 4d53216c05)

* Migration (partially) of update.sh + cold-standby.sh to composev2

* Migration of update.sh + cold-standby.sh to composev2

* Migration of update.sh + cold-standby.sh to composev2

* Migration of update.sh + cold-standby.sh to composev2

* [ClamAV] Fixed ClamAV start before unbound

* Migration of update.sh + cold-standby.sh to composev2

* Formulation and values adjusted (IPv4 bind in generate-config.sh)

Co-authored-by: Amin Vakil <info@aminvakil.com>
Co-authored-by: qupfer <github@qupfer.de>
Co-authored-by: FreddleSpl0it <patschul@posteo.de>
2022-06-07 08:53:08 +02:00
andryyy
769e08843b [Helper] Backup and restore: Use bullseye-slim 2022-03-14 13:10:39 +01:00
Joachim Astel
b1adbb38e6 Update backup_and_restore.sh (#4098)
Script breaks when there are more then one name matching,  see Issue #4097
2021-05-16 08:19:52 +02:00
Sven Gottwald
f11660a5d8 [Helper] Update backup_and_restore.sh (#4005)
Allocate a pseudo-tty for the mariabackup container process. This allows to 
redirect the complete output of the the backup script to a file.
2021-04-20 21:24:31 +02:00
andryyy
46928269bb [Backup Helper] Possible workaround for #3913 2020-12-31 23:26:03 +01:00
Luca Kröger
d3e21aae08 added selinux labels to backup_and_restore script (#3874) 2020-12-06 09:29:25 +01:00
andryyy
100650a25e [Helper] Use 999:999 as owner instead of mysql:mysql 2020-11-04 10:17:59 +01:00
andryyy
d3a14f397c [Helper] Allow to run backup script everywhere 2020-10-03 11:11:48 +02:00
Maxim Baz
05a5f9e84a Support mailcow.conf being a symlink (#3770)
* Support mailcow.conf being a symlink

* Detect BusyBox sed in update.sh
2020-09-20 22:07:37 +02:00
Ry3nlNaToR
5d36828f00 Speed up Gziping of backup (#3623)
Changed Gzip compression level to default (-6)
2020-06-26 22:09:43 +02:00
Florian Lindner
36890de7f4 Make delete-days delete only files with mailcow-* in backup location (#3609)
Co-authored-by: Florian Lindner <florian.lindner@ipvs.uni-stuttgart.de>
2020-06-15 07:28:42 +02:00
jonasled
09dc7518be fixed backup failing (#3592) 2020-06-05 12:07:02 +02:00
andryyy
e01c24aa05 [Helper] Fix mariadb restore when "all" is selected, thanks to @takigama 2020-06-03 08:22:55 +02:00
Süleyman ŞAHİN
ccf65fb50f Update backup_and_restore.sh (#3493)
Fix error while "Arguments to -type should contain only one letter" on CentOS
2020-04-19 09:56:56 +02:00
Christian Burmeister
25f7ecc542 Update backup_and_restore.sh (#3490)
Upate debian docker image from "debian:stretch-slim" to "debian:buster-slim".
2020-04-18 20:13:38 +02:00
Timo N
a63bad41bf [Helper] Added name to backup and restore containers (#3477) 2020-04-14 14:20:05 +02:00
andryyy
e7a8c84c03 [Helper] Remove useless rsync 2020-04-13 21:35:20 +02:00
andryyy
07c7da2821 [Helper] Create tar archives for SQL backups 2020-04-06 18:46:31 +02:00
andryyy
212c18fd08 [Helper] backup fixes 2020-03-29 15:50:29 +02:00
andryyy
a71d991c12 [Helper] Fix for numbers in compose project name 2020-03-29 10:45:27 +02:00
andryyy
ba246d34cb [Helper] Some minor improvements 2020-03-28 19:50:18 +01:00
Marc-Niclas H
f7b94f8d77 Fix restore script not restoring MySQL database on restore (#3383)
* Fix restore script not restoring MySQL database on restore

* Add missing 'type' and 'maxdepth' options to 'find' command in backup and restore script
2020-03-03 20:12:11 +01:00
andryyy
a1156c38fc [Helper] Use mariabackup for SQL 2020-02-26 07:09:56 +01:00