You can either keep track of the directories you have already archived, and before you start archiving each directory make sure you haven't already done it; or else pre-process your list of directories and remove any that are included in earlier directories.