pibackup
Raspberry Pi backup & restore tool – create, shrink & compress
...Unlike typical SD card tools, it is optimized for large storage devices such as SSDs and HDDs, while still working seamlessly with smaller devices. It creates backups of the first two partitions of any storage device and provides selective restoration. After creating a backup, pibackup can automatically remove specified files and folders from the image, shrink it, and compress it efficiently using Zstandard (.zst) to save space.