]> gitweb.hhaalo.de Git - simple-backup.git/commitdiff
change backup with long parameter
authorBastian Dehn <hhaalo@arcor.de>
Sun, 25 May 2025 05:36:30 +0000 (07:36 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 25 May 2025 05:36:30 +0000 (07:36 +0200)
backup

diff --git a/backup b/backup
index 0c87d81bde76f3028bbdbe8b084440a40a923044..337f21283de648a56cfe6b4c93772f7215834191 100755 (executable)
--- a/backup
+++ b/backup
@@ -123,7 +123,7 @@ backup_remotes()
        local machine=
        for machine in $machines; do
                echo "ℹ️  INFO: create direcotry $backup_path/$machine"
-               mkdir -p $backup_path/$machine \
+               mkdir --parents $backup_path/$machine \
                        || errlog "could not create directory $backup_path/$machine" \
                        || return $?
 
@@ -218,9 +218,9 @@ is_backup_old()
        local diff=$(( ($(date --date="$backup_date" +%s) - $(date +%s)) / 86400 ))
 
        case "$backup_typ" in
-       "day") [ $diff -ge 0 ] || return 1 ;;
-       "week") [ $diff -ge -6 ] || return 1 ;;
-       "month") [ "$backup_month" == "$now_month" ] || return 1 ;;
+       "day") [ $diff -ge 0 ] || return $? ;;
+       "week") [ $diff -ge -6 ] || return $? ;;
+       "month") [ "$backup_month" == "$now_month" ] || return $? ;;
        *) return 0;;
        esac
 }