Zend certified PHP/Magento developer

Why are not all my files included when I gzip a directory?

I know this is a question that has been asked before, for example here Recursively count all the files in a directory,
but this is driving me crazy. Let me explain:
I have a directory called “data” on a server with tons of subdirectories. if I call

find data -type f | wc -l

on it, it says 23609.

If I FTP down the entire catalog with Transmit (Mac app), when it is done the app says “downloaded 35968 items” this matches files+directories, so ok.

if I run the same command on my local dir, I get 23609.

NOW.

if I gzip that same directory on the server, using:

tar -zcvf /mydir/data.tar.gz /.....directories/data

,FTP that single file, and untar it, and THEN run the same command on the untar’ed directory, I get 23441! So, that’s 168 files missing from the gzip file. The zipped file is 9,54 GB.

I ran diff on it and there were 2 subdirectories with missing files that were completely missing from the gz, and 2 more directories that only had some of the files.

I cannot for the life of me figure out why this differs. the two directories with some missing files have 3478 and 1589 files. The ones that were completely missing only had a few.

I cannot see any difference in rights nor size. they all have randomly generated filenames like ‘7eac63ce-75b3-4b7a-b569-1c5fb0f57f7b’

I am stumped. Hoping someone can shed some light on why not all files are included, I’m not super great at this stuff.

(using gzip 1.5
Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc.
Copyright (C) 1993 Jean-loup Gailly.)