Ticket #6 (closed defect: fixed)

Opened 9 months ago

Last modified 9 months ago

Eloy quits without action when EXCLUDES var is empty

Reported by: gerrit@… Owned by: rahab
Priority: major Milestone: Release 1.0
Version: 0.2 Keywords:
Cc:

Description (last modified by rahab) (diff)

In my eloy.cf the Excludes var looks like
EXCLUDES=""

When I run eloy it tells me:
root@popula-web01:~# /root/scripts/eloy/eloy.sh backup
Missing EXCLUDES in "/root/scripts/eloy/eloy.cf".

I think excludes shouldn't be mandatory ;)

Attachments

eloy.sh (13.9 kB) - added by rahab 9 months ago.
fixed version

Change History

Changed 9 months ago by rahab

  • owner set to rahab
  • status changed from new to assigned
  • description modified (diff)

Changed 9 months ago by max

  • milestone set to Release 1.0

Changed 9 months ago by rahab

fixed version

Changed 9 months ago by rahab

  • status changed from assigned to closed
  • resolution set to fixed

Removed

195             if [ -z "$EXCLUDES" ]; then
196 	                missingConfigVariable "EXCLUDES"
197 	        fi

Doesn't make sense to me, since "-t" tests for a null-length string and that's perfectly OK to have, if you don't need esclusions. Instead of that I added an if-clause around the exclude-handling:

                if [ ! -z "$EXCLUDES" ]; then
                for EXCLUDE in $EXCLUDES
                do
                        if [[ "$EXCLUDE" == "$SOURCE"* ]]; then
                                ARGS="$ARGS --exclude=/`basename $SOURCE`${EXCLUDE:${#SOURCE}}"
                        fi
                done
                fi

Now the exclusion handling is only triggered if EXCLUDE is NOT a zero-length string.

Besindes that I also adjusted the informational output to reflect a possible not-existing exclude.

        if [ -z "$EXCLUDES" ]; then
                echo "Excludes: no excludes defined"
        else
                echo "Excludes: $EXCLUDES"
        fi

Add/Change #6 (Eloy quits without action when EXCLUDES var is empty)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.