Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove extraneous flags #38

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions zfs-inplace-rebalancing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,19 @@ function rebalance () {
# Linux

# --reflink=never -- force standard copy (see ZFS Block Cloning)
# -a -- keep attributes
# -d -- keep symlinks (dont copy target)
# -a -- keep attributes, includes -d -- keep symlinks (dont copy target) and
# -p -- preserve ACLs to
# -x -- stay on one system
# -p -- preserve ACLs too
cp --reflink=never -adxp "${file_path}" "${tmp_file_path}"
cp --reflink=never -ax "${file_path}" "${tmp_file_path}"
elif [[ "${OSTYPE,,}" == "darwin"* ]] || [[ "${OSTYPE,,}" == "freebsd"* ]]; then
# Mac OS
# FreeBSD

# -a -- Archive mode. Same as -RpP.
# -a -- Archive mode. Same as -RpP. Includes preservation of modification
# time, access time, file flags, file mode, ACL, user ID, and group
# ID, as allowed by permissions.
# -x -- File system mount points are not traversed.
# -p -- Cause cp to preserve the following attributes of each source file
# in the copy: modification time, access time, file flags, file mode,
# ACL, user ID, and group ID, as allowed by permissions.
cp -axp "${file_path}" "${tmp_file_path}"
cp -ax "${file_path}" "${tmp_file_path}"
else
echo "Unsupported OS type: $OSTYPE"
exit 1
Expand Down