Search, Tar and Compress in one line

Hi all,

I am supposed to collect a huge amount of log files from a unix system (HP-UX) onto a local system. The log files are not in one place, but they are scattered all over the Unix server. The unix server has only limited space, so that I can not create a tar file first and then compress it. I am trying to do something like tar -cvf | gzip -c but it fails due to spaces in the file name.
The command I am trying is:
find /BaseDirectory -name "*.log" | xargs tar -cvf | gzip -c > AllLogFiles.tgz
I am getting errors like:
tar: cannot stat ./BACKUP/24-11-2007. Not dumped.
tar: cannot stat 02.52.45-BACKUP.log. Not dumped.
tar: cannot stat ./BACKUP/24-11-2007. Not dumped.
tar: cannot stat 02.56.40-BACKUP.log. Not dumped.
tar: cannot stat ./BACKUP/24-11-2007. Not dumped.

Is it because of spaces or hyphens in the file name? Or am I trying a wrong command? (Original filenames are like "24-11-2007 02.53.32-BACKU.log")

Alternatively, Is there any way that I can collect all *.log files into one compressed file (so that the command doesn't error out due to lack of space while collecting log files)? The actual archive type is not important, it could be gzip, compress, pack or anything.

Thanks for reading my query, and have a nice day/evening.

Hi,
How about search, cpio and compress ? since tar is just an archiver as well as cpio which does no compression at all ?

find . -name "*.log" -print | cpio -o | gzip -c > AllLogFiles.cpio.gz # to compress
gzip -dc AllLogFiles.cpio.gz | cpio -i # to decompress 

Thanks andryk, that was real quick.
I executed that on a small folder, and the first command worked properly. However, the second one is giving error:
missing 'd' option
Cannot create directory for <mainlog> (errno:2)
missing 'd' option
Cannot create directory for <BACKUP> (errno:2)
missing 'd' option
Cannot create directory for <BACKUP> (errno:2)
missing 'd' option
Cannot create directory for <BACKUP> (errno:2)
....
....

Any ideas?

I added -d to cpio and the problem is solved.

Thanks andryk, you have saved me a lot of trouble, and it was quick.:). This forum is amazing...

Well, glad i could help ... and sorry i forgot that 'd', first time using cpio :wink: