zfs-recompress.sh - trigger ZFS compression on a set of files
zfs-recompress.sh [OPTION1], [OPTION2], ...
Call the zfs-recompress.sh script to replicate, verify and overwrite all files in the current working directory and all its descendant directories in order to trigger ZFS compression.
-f, --folder FOLDER
process the specified FOLDER instead of the current working directory
-d, --dry-run
test every source file for readability/size and try to create an empty file in every destination directory (fast) instead of a full replicate, verify and overwrite cycle (slow)
-h, --help
display usage help and exit
Examples:
-
running
zfs-recompress.sh
in the/mnt/files/foo/
directory will process all files in/mnt/files/foo/
,/mnt/files/foo/bar/
,/mnt/files/foo/bar/baz/
and so on, but will not process files in/mnt/files/
-
running
zfs-recompress.sh --folder /mnt/files/
in the/mnt/files/foo/
directory will process all files in/mnt/files/
,/mnt/files/foo/
,/mnt/files/foo/bar/
,/mnt/files/foo/bar/baz/
and so on
-
Linux (tested under Ubuntu 20.04)
-
FreeBSD / FreeNAS (tested under FreeBSD 11.3, needs:
pkg install bash; ln -s /usr/local/bin/bash /bin/bash
)
Files that are hard-linked (as well as all their hard links) are skipped. You must process those files manually. In order to find all files with one or more hard links, try: find . -type f -links +1 -printf '%i %n %p\n'
.
Please report zfs-recompress.sh bugs through GitHub.
ALWAYS MAKE A BACKUP BEFORE BATCH-PROCESSING COMPUTER FILES IN ANY WAY.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
Further information is available through comments within the zfs-recompress.sh script itself, readable with any text editor.