diff --git a/CHANGELOG.md b/CHANGELOG.md index bfb2412..c61ea87 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,24 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.17.0] + +### Added + +- RSync + - rsync-copy-dir-cifs + +### Changed + +- RSync + - rsync-clone-dir-send-root -> rsync-clone-dir-local + - rsync-clone-dir-send-user -> rsync-copy-dir-local + +### Removed + +- RSync + - rsync-clone-dir-list-delta + ## [0.16.0] ### Added diff --git a/src/aws-eks/aws-eks-addons-show b/src/aws-eks/aws-eks-addons-show index c3da964..f649581 100755 --- a/src/aws-eks/aws-eks-addons-show +++ b/src/aws-eks/aws-eks-addons-show @@ -3,7 +3,7 @@ ####################################### # AWS / EKS / AddOns / Show # -# Version: 1.1.0 +# Version: 1.1.1 # ####################################### # Copyright [2024] [serdigital64@gmail.com] @@ -43,7 +43,7 @@ function aws_eks_addons_list() { list-addons \ $BL64_AWS_SET_FORMAT_JSON \ --cluster-name "$cluster_name" | - "$S64_CORE_PATH_JQ" \ + bl64_xsv_run_jq \ -r '.addons[]' } @@ -63,7 +63,6 @@ function aws_eks_addons_show() { function initialize() { bl64_dbg_app_show_function bl64_check_parameter 'CLUSTER_NAME' && - bl64_check_command_search_path "$S64_CORE_PATH_JQ" && s64_aws_lib_setup } diff --git a/src/core/aws-lib b/src/core/aws-lib index 238570c..9402604 100755 --- a/src/core/aws-lib +++ b/src/core/aws-lib @@ -3,7 +3,7 @@ ####################################### # AWS / Lib # -# Version: 2.0.0 +# Version: 2.1.0 # ####################################### # Copyright [2024] [serdigital64@gmail.com] @@ -26,7 +26,8 @@ # # shellcheck disable=SC2015,SC2154 source-path=SCRIPTDIR/../../lib/bl64 -source "${S64_CORE_PATH_BL64}/bashlib64-module-bsh.bash" || +source "${S64_CORE_PATH_BL64}/bashlib64-module-xsv.bash" || + source "${S64_CORE_PATH_BL64}/bashlib64-module-bsh.bash" || source "${S64_CORE_PATH_BL64}/bashlib64-module-fmt.bash" && source "${S64_CORE_PATH_BL64}/bashlib64-module-txt.bash" && source "${S64_CORE_PATH_BL64}/bashlib64-module-fs.bash" && @@ -57,7 +58,9 @@ source "${S64_CORE_PATH_BL64}/bashlib64-module-bsh.bash" || # function s64_aws_lib_setup() { - bl64_aws_setup && + bl64_dbg_app_show_function + bl64_xsv_setup && + bl64_aws_setup && s64_aws_lib_access_check } diff --git a/src/core/core-lib b/src/core/core-lib index 6e9f910..f7db2ae 100755 --- a/src/core/core-lib +++ b/src/core/core-lib @@ -3,7 +3,7 @@ ####################################### # Core / Lib # -# Version: 1.2.0 +# Version: 2.0.0 # ####################################### # Copyright [2024] [serdigital64@gmail.com] @@ -27,16 +27,26 @@ # shellcheck disable=SC2034 { - # Default SysOp64 install path - declare S64_CORE_PATH_ROOT="${S64_CORE_PATH_ROOT:-/opt/sysop64}" - # Default BL64 install path - declare S64_CORE_PATH_BL64="${S64_CORE_PATH_BL64:-/opt/bl64}" - - # Default debut level - declare S64_CORE_SET_DEBUG="${S64_CORE_SET_DEBUG:-NONE}" - # Default verbose level - declare S64_CORE_SET_VERBOSE="${S64_CORE_SET_VERBOSE:-ALL}" - - # Default JQuery tool path - declare S64_CORE_PATH_JQ="${S64_CORE_PATH_JQ:-/usr/bin/jq}" + # Default SysOp64 install path + declare S64_CORE_PATH_ROOT="${S64_CORE_PATH_ROOT:-/opt/sysop64}" + + # Default BL64 install path + declare S64_CORE_PATH_BL64="${S64_CORE_PATH_BL64:-/opt/bl64}" + + # Default log repository + declare S64_CORE_PATH_LOGS="${S64_CORE_PATH_LOGS:-${HOME}/logs-sysop64}" + + # Default debut level + declare S64_CORE_SET_DEBUG="${S64_CORE_SET_DEBUG:-NONE}" + + # Default verbose level + declare S64_CORE_SET_VERBOSE="${S64_CORE_SET_VERBOSE:-ALL}" +} + +# +# Functions +# + +function s64_core_lib_setup_logging() { + : } diff --git a/src/core/rsync-lib b/src/core/rsync-lib index 1383c63..614ef7e 100755 --- a/src/core/rsync-lib +++ b/src/core/rsync-lib @@ -3,7 +3,7 @@ ####################################### # RSync / Lib # -# Version: 2.0.0 +# Version: 2.1.0 # ####################################### # Copyright [2024] [serdigital64@gmail.com] @@ -26,7 +26,12 @@ # # shellcheck disable=SC2015,SC2154 source-path=SCRIPTDIR/../../lib/bl64 -source "${S64_CORE_PATH_BL64}/bashlib64-module-ui.bash" && +source "${S64_CORE_PATH_BL64}/bashlib64-module-log.bash" && + source "${S64_CORE_PATH_BL64}/bashlib64-module-fs.bash" && + source "${S64_CORE_PATH_BL64}/bashlib64-module-txt.bash" && + source "${S64_CORE_PATH_BL64}/bashlib64-module-xsv.bash" && + source "${S64_CORE_PATH_BL64}/bashlib64-module-fmt.bash" && + source "${S64_CORE_PATH_BL64}/bashlib64-module-ui.bash" && source "${S64_CORE_PATH_BL64}/bashlib64-module-bsh.bash" || { echo 'Error: unable to load bashlib64' && exit 1; } @@ -37,20 +42,15 @@ source "${S64_CORE_PATH_BL64}/bashlib64-module-ui.bash" && # shellcheck disable=SC2034 { declare S64_RSYNC_PATH_CLI="${S64_RSYNC_PATH_CLI:-}" + declare S64_RSYNC_OPTIONS_COMMON='' S64_RSYNC_OPTIONS_COMMON+=' --one-file-system' - S64_RSYNC_OPTIONS_COMMON+=' --human-readable' - S64_RSYNC_OPTIONS_COMMON+=' --progress' - S64_RSYNC_OPTIONS_COMMON+=' --stats' - S64_RSYNC_OPTIONS_COMMON+=' --recursive' S64_RSYNC_OPTIONS_COMMON+=' --checksum' - S64_RSYNC_OPTIONS_COMMON+=' --links' - S64_RSYNC_OPTIONS_COMMON+=' --delete' S64_RSYNC_OPTIONS_COMMON+=' --mkpath' - S64_RSYNC_OPTIONS_COMMON+=' --verbose' - S64_RSYNC_OPTIONS_COMMON+=' --perms' - S64_RSYNC_OPTIONS_COMMON+=' --checksum' - S64_RSYNC_OPTIONS_COMMON+=' --compress' + + declare S64_RSYNC_OPTIONS_LOCAL='' + S64_RSYNC_OPTIONS_LOCAL+=' --links' + S64_RSYNC_OPTIONS_LOCAL+=' --perms' } # @@ -68,7 +68,7 @@ function s64_rsync_lib_setup() { function s64_rsync_lib_run_rsync() { bl64_dbg_app_show_function "$@" - local verbose_flag='--verbose' + local verbose_flag='--human-readable --verbose --stats' bl64_msg_app_verbose_enabled || verbose_flag=' ' bl64_dbg_app_trace_start # shellcheck disable=SC2086 diff --git a/src/linux-fs/linux-fs-cifs-mount b/src/linux-fs/linux-fs-cifs-mount index 5234784..a69f6f5 100755 --- a/src/linux-fs/linux-fs-cifs-mount +++ b/src/linux-fs/linux-fs-cifs-mount @@ -3,7 +3,7 @@ ####################################### # Linux / FS / CIFS / Mount # -# Version: 1.0.1 +# Version: 1.0.2 # ####################################### # Copyright [2024] [serdigital64@gmail.com] @@ -40,7 +40,8 @@ function initialize() { bl64_check_privilege_root && bl64_check_parameter 'CIFS_SERVER_IP' && bl64_check_parameter 'CIFS_SHARE_NAME' && - bl64_check_parameter 'MOUNT_PATH' + bl64_check_parameter 'MOUNT_PATH' && + bl64_check_directory "$MOUNT_PATH" && s64_linux_lib_setup } diff --git a/src/rsync/rsync-clone-dir-send-root b/src/rsync/rsync-clone-dir-local similarity index 87% rename from src/rsync/rsync-clone-dir-send-root rename to src/rsync/rsync-clone-dir-local index 1762532..b891009 100755 --- a/src/rsync/rsync-clone-dir-send-root +++ b/src/rsync/rsync-clone-dir-local @@ -1,9 +1,9 @@ #!/usr/bin/env bash # template-one: 2.0.0 ####################################### -# RSync / Clone / Dir / Send / Root +# RSync / Clone / Dir / Local # -# Version: 1.0.1 +# Version: 1.0.2 # ####################################### # Copyright [2024] [serdigital64@gmail.com] @@ -38,10 +38,10 @@ source "${S64_CORE_PATH_BL64}/bashlib64-core.bash" || { echo 'Error: unable to l function initialize() { bl64_dbg_app_show_function bl64_check_privilege_root && - s64_rsync_lib_setup && bl64_check_parameter 'RSYNC_CLONE_FROM' && bl64_check_parameter 'RSYNC_CLONE_TO' && - bl64_check_directory "$RSYNC_CLONE_FROM" + bl64_check_directory "$RSYNC_CLONE_FROM" && + s64_rsync_lib_setup } # @@ -53,10 +53,14 @@ declare RSYNC_CLONE_TO="${2:-}" bl64_dbg_set_level "$S64_CORE_SET_DEBUG" && bl64_msg_set_level "$S64_CORE_SET_VERBOSE" && initialize || exit $? bl64_msg_show_batch_start "$BL64_SCRIPT_ID" +bl64_msg_show_info 'Copy files from Linux path to Linux path. Operation is privileged, source file ownership is kept.' # shellcheck disable=SC2086 bl64_ui_ask_confirmation "Warning: destination content will be replaced (${RSYNC_CLONE_FROM} -> ${RSYNC_CLONE_TO})" && s64_rsync_lib_run_rsync \ $S64_RSYNC_OPTIONS_COMMON \ + $S64_RSYNC_OPTIONS_LOCAL \ + --recursive \ + --delete \ --owner \ --group \ --times \ diff --git a/src/rsync/rsync-clone-dir-send-user b/src/rsync/rsync-copy-dir-cifs similarity index 85% rename from src/rsync/rsync-clone-dir-send-user rename to src/rsync/rsync-copy-dir-cifs index 20c9adc..ae71451 100755 --- a/src/rsync/rsync-clone-dir-send-user +++ b/src/rsync/rsync-copy-dir-cifs @@ -1,9 +1,9 @@ #!/usr/bin/env bash # template-one: 2.0.0 ####################################### -# RSync / Clone / Dir / Send / User +# RSync / Copy / Dir / CIFS # -# Version: 1.0.1 +# Version: 1.0.0 # ####################################### # Copyright [2024] [serdigital64@gmail.com] @@ -52,10 +52,20 @@ declare RSYNC_CLONE_TO="${2:-}" bl64_dbg_set_level "$S64_CORE_SET_DEBUG" && bl64_msg_set_level "$S64_CORE_SET_VERBOSE" && initialize || exit $? bl64_msg_show_batch_start "$BL64_SCRIPT_ID" +bl64_msg_show_info 'Copy files from Linux path to CIFS path. The operation will try to adapt linux files attributes and names to CIFS equivalents.' # shellcheck disable=SC2086 bl64_ui_ask_confirmation "Warning: destination content will be replaced (${RSYNC_CLONE_FROM} -> ${RSYNC_CLONE_TO})" && s64_rsync_lib_run_rsync \ $S64_RSYNC_OPTIONS_COMMON \ + --recursive \ + --delete \ + --no-links \ + --no-perms \ + --no-acls \ + --no-owner \ + --no-group \ + --no-devices \ + --numeric-ids \ "$RSYNC_CLONE_FROM" \ "$RSYNC_CLONE_TO" bl64_msg_show_batch_finish $? "$BL64_SCRIPT_ID" diff --git a/src/rsync/rsync-clone-dir-list-delta b/src/rsync/rsync-copy-dir-local similarity index 74% rename from src/rsync/rsync-clone-dir-list-delta rename to src/rsync/rsync-copy-dir-local index b2f755f..ce9af6d 100755 --- a/src/rsync/rsync-clone-dir-list-delta +++ b/src/rsync/rsync-copy-dir-local @@ -1,9 +1,9 @@ #!/usr/bin/env bash # template-one: 2.0.0 ####################################### -# RSync / Clone / Dir / List / Delta +# RSync / Copy / Dir / Local # -# Version: 1.0.1 +# Version: 1.0.2 # ####################################### # Copyright [2024] [serdigital64@gmail.com] @@ -37,10 +37,10 @@ source "${S64_CORE_PATH_BL64}/bashlib64-core.bash" || { echo 'Error: unable to l function initialize() { bl64_dbg_app_show_function - s64_rsync_lib_setup && - bl64_check_parameter 'RSYNC_CLONE_FROM' && + bl64_check_parameter 'RSYNC_CLONE_FROM' && bl64_check_parameter 'RSYNC_CLONE_TO' && - bl64_check_directory "$RSYNC_CLONE_FROM" + bl64_check_directory "$RSYNC_CLONE_FROM" && + s64_rsync_lib_setup } # @@ -52,11 +52,14 @@ declare RSYNC_CLONE_TO="${2:-}" bl64_dbg_set_level "$S64_CORE_SET_DEBUG" && bl64_msg_set_level "$S64_CORE_SET_VERBOSE" && initialize || exit $? bl64_msg_show_batch_start "$BL64_SCRIPT_ID" -bl64_msg_show_task "Show delta between source and destination (${RSYNC_CLONE_FROM} -> ${RSYNC_CLONE_TO})" +bl64_msg_show_info 'Copy files from Linux path to Linux path. Operation is non-privileged, source file ownership is not kept.' # shellcheck disable=SC2086 -s64_rsync_lib_run_rsync \ - $S64_RSYNC_OPTIONS_COMMON \ - --dry-run \ - "$RSYNC_CLONE_FROM" \ - "$RSYNC_CLONE_TO" +bl64_ui_ask_confirmation "Warning: destination content will be replaced (${RSYNC_CLONE_FROM} -> ${RSYNC_CLONE_TO})" && + s64_rsync_lib_run_rsync \ + $S64_RSYNC_OPTIONS_COMMON \ + $S64_RSYNC_OPTIONS_LOCAL \ + --recursive \ + --delete \ + "$RSYNC_CLONE_FROM" \ + "$RSYNC_CLONE_TO" bl64_msg_show_batch_finish $? "$BL64_SCRIPT_ID"