add --reflink=never to cp on linux (#34)

This commit is contained in:
Markus Ressel 2023-11-11 11:08:36 +01:00 committed by GitHub
parent d6cbeb3f40
commit 979edb265c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,11 +92,12 @@ function rebalance () {
if [[ "${OSTYPE,,}" == "linux-gnu"* ]]; then
# Linux
# --reflink=never -- force standard copy (see ZFS Block Cloning)
# -a -- keep attributes
# -d -- keep symlinks (dont copy target)
# -x -- stay on one system
# -p -- preserve ACLs too
cp -adxp "${file_path}" "${tmp_file_path}"
cp --reflink=never -adxp "${file_path}" "${tmp_file_path}"
elif [[ "${OSTYPE,,}" == "darwin"* ]] || [[ "${OSTYPE,,}" == "freebsd"* ]]; then
# Mac OS
# FreeBSD