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 $?
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
}