diff --git a/.metadata b/.metadata index ff38257..782f498 100644 Binary files a/.metadata and b/.metadata differ diff --git a/.templates/bin/rotate_folder b/.templates/bin/rotate_folder index 3b72121..ef23546 100755 --- a/.templates/bin/rotate_folder +++ b/.templates/bin/rotate_folder @@ -55,6 +55,9 @@ # Author: Kovács Zoltán # Kovács Zoltán # License: GNU/GPL v3+ (https://www.gnu.org/licenses/gpl-3.0.en.html) +# 2025-03-06 v1.1 +# new: added the --noconf option which prevents reading and creating +# the configuration file. # 2023-06-18 v1.0 # new: forked from the "SMARTERP_skeleton" repository. # 2021.02.12 v0.3 @@ -77,6 +80,7 @@ RETAIN_MONTHS=${RETAIN_MONTHS-"12"} # Other initialisations (maybe overridden by configuration). # DOIT="" +NOCONF="" # Messages (maybe overriden by configuration). # @@ -106,6 +110,7 @@ do case ${option} in "-" ) if [ "$OPTARG" = "doit" ]; then DOIT="yes" + elif [ "$OPTARG" = "noconf" ]; then NOCONF="yes" else echo "$MSG_BADOPT --$OPTARG" >&2; exit 1 fi ;; @@ -135,9 +140,10 @@ BACKUP_FOLDER=${BACKUP_FOLDER%/} if [ -z "$BACKUP_FOLDER" -o ! -d "$BACKUP_FOLDER" -o ! -w "$BACKUP_FOLDER" ] then echo -e "$MSG_BADFOLDER $BACKUP_FOLDER" >&2; exit 1; fi -# Gets the configuration (if any). +# Applies the configuration (if it exists and if it doesn't need to be ignored). BACKUP_CONF="$BACKUP_FOLDER/.$("$BASENAME" "$0").conf" -if [ -r $BACKUP_CONF ]; then . "$BACKUP_CONF" +if [ "$NOCONF" = "yes" ]; then : +elif [ -r $BACKUP_CONF ]; then . "$BACKUP_CONF" else # Warns about failure. echo -e "$MSG_NOCONF $BACKUP_CONF"